@graphql-eslint/eslint-plugin 2.3.2-alpha-99be3d2.0 → 2.3.2-alpha-2901045.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.js +2 -9
  2. package/index.mjs +2 -9
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -612,7 +612,7 @@ const rule = {
612
612
  ],
613
613
  },
614
614
  messages: {
615
- [ALPHABETIZE]: '"{{ currName }}" should be before "{{ prevName }}".',
615
+ [ALPHABETIZE]: '"{{ currName }}" should be before "{{ prevName }}"',
616
616
  },
617
617
  schema: {
618
618
  type: 'array',
@@ -669,16 +669,9 @@ const rule = {
669
669
  for (const node of nodes) {
670
670
  const currName = node.name.value;
671
671
  if (prevName && prevName > currName) {
672
- const { start, end } = node.name.loc;
673
672
  const isVariableNode = node.kind === graphql.Kind.VARIABLE;
674
673
  context.report({
675
- loc: {
676
- start: {
677
- line: start.line,
678
- column: start.column - (isVariableNode ? 2 : 1),
679
- },
680
- end,
681
- },
674
+ loc: getLocation(node.loc, node.name.value, { offsetEnd: isVariableNode ? 0 : 1 }),
682
675
  messageId: ALPHABETIZE,
683
676
  data: isVariableNode
684
677
  ? {
package/index.mjs CHANGED
@@ -606,7 +606,7 @@ const rule = {
606
606
  ],
607
607
  },
608
608
  messages: {
609
- [ALPHABETIZE]: '"{{ currName }}" should be before "{{ prevName }}".',
609
+ [ALPHABETIZE]: '"{{ currName }}" should be before "{{ prevName }}"',
610
610
  },
611
611
  schema: {
612
612
  type: 'array',
@@ -663,16 +663,9 @@ const rule = {
663
663
  for (const node of nodes) {
664
664
  const currName = node.name.value;
665
665
  if (prevName && prevName > currName) {
666
- const { start, end } = node.name.loc;
667
666
  const isVariableNode = node.kind === Kind.VARIABLE;
668
667
  context.report({
669
- loc: {
670
- start: {
671
- line: start.line,
672
- column: start.column - (isVariableNode ? 2 : 1),
673
- },
674
- end,
675
- },
668
+ loc: getLocation(node.loc, node.name.value, { offsetEnd: isVariableNode ? 0 : 1 }),
676
669
  messageId: ALPHABETIZE,
677
670
  data: isVariableNode
678
671
  ? {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-eslint/eslint-plugin",
3
- "version": "2.3.2-alpha-99be3d2.0",
3
+ "version": "2.3.2-alpha-2901045.0",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
6
  "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0"