@graphql-eslint/eslint-plugin 4.4.0-alpha-20241207210859-41eb4549764dc0314b5bd4f257ea6667b178540e → 4.4.0-alpha-20241210121000-22133a7d66f4a5d831e5588ca0ce4fc789bca4ed
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.
- package/cjs/graphql-config.d.cts +1 -2
- package/cjs/index.d.cts +1 -2
- package/cjs/meta.js +1 -1
- package/cjs/parser.d.cts +1 -2
- package/cjs/rules/alphabetize/index.d.cts +1 -1
- package/cjs/rules/alphabetize/index.js +2 -1
- package/cjs/rules/description-style/index.d.cts +1 -1
- package/cjs/rules/description-style/index.js +3 -1
- package/cjs/rules/graphql-js-validation.d.cts +1 -2
- package/cjs/rules/graphql-js-validation.js +31 -30
- package/cjs/rules/index.d.cts +1 -2
- package/cjs/rules/input-name/index.d.cts +1 -1
- package/cjs/rules/input-name/index.js +3 -1
- package/cjs/rules/lone-executable-definition/index.d.cts +1 -1
- package/cjs/rules/lone-executable-definition/index.js +2 -1
- package/cjs/rules/match-document-filename/index.d.cts +1 -1
- package/cjs/rules/match-document-filename/index.js +2 -1
- package/cjs/rules/naming-convention/index.d.cts +1 -1
- package/cjs/rules/naming-convention/index.js +3 -1
- package/cjs/rules/no-anonymous-operations/index.d.cts +1 -2
- package/cjs/rules/no-anonymous-operations/index.js +2 -1
- package/cjs/rules/no-deprecated/index.d.cts +1 -2
- package/cjs/rules/no-deprecated/index.js +2 -1
- package/cjs/rules/no-duplicate-fields/index.d.cts +1 -2
- package/cjs/rules/no-duplicate-fields/index.js +2 -1
- package/cjs/rules/no-hashtag-description/index.d.cts +1 -2
- package/cjs/rules/no-hashtag-description/index.js +2 -1
- package/cjs/rules/no-one-place-fragments/index.d.cts +1 -2
- package/cjs/rules/no-one-place-fragments/index.js +1 -1
- package/cjs/rules/no-root-type/index.d.cts +1 -1
- package/cjs/rules/no-root-type/index.js +3 -1
- package/cjs/rules/no-scalar-result-type-on-mutation/index.d.cts +1 -2
- package/cjs/rules/no-scalar-result-type-on-mutation/index.js +2 -1
- package/cjs/rules/no-typename-prefix/index.d.cts +1 -2
- package/cjs/rules/no-typename-prefix/index.js +2 -1
- package/cjs/rules/no-unreachable-types/index.d.cts +1 -2
- package/cjs/rules/no-unreachable-types/index.js +2 -1
- package/cjs/rules/no-unused-fields/index.d.cts +1 -1
- package/cjs/rules/no-unused-fields/index.js +2 -1
- package/cjs/rules/relay-arguments/index.d.cts +1 -1
- package/cjs/rules/relay-arguments/index.js +1 -1
- package/cjs/rules/relay-connection-types/index.d.cts +1 -2
- package/cjs/rules/relay-connection-types/index.js +1 -1
- package/cjs/rules/relay-edge-types/index.d.cts +1 -1
- package/cjs/rules/relay-edge-types/index.js +1 -1
- package/cjs/rules/relay-page-info/index.d.cts +1 -2
- package/cjs/rules/relay-page-info/index.js +1 -1
- package/cjs/rules/require-deprecation-date/index.d.cts +1 -1
- package/cjs/rules/require-deprecation-date/index.js +2 -1
- package/cjs/rules/require-deprecation-reason/index.d.cts +1 -2
- package/cjs/rules/require-deprecation-reason/index.js +1 -1
- package/cjs/rules/require-description/index.d.cts +1 -1
- package/cjs/rules/require-description/index.js +2 -1
- package/cjs/rules/require-field-of-type-query-in-mutation-result/index.d.cts +1 -2
- package/cjs/rules/require-field-of-type-query-in-mutation-result/index.js +1 -1
- package/cjs/rules/require-import-fragment/index.d.cts +1 -2
- package/cjs/rules/require-import-fragment/index.js +2 -1
- package/cjs/rules/require-nullable-fields-with-oneof/index.d.cts +1 -2
- package/cjs/rules/require-nullable-fields-with-oneof/index.js +1 -1
- package/cjs/rules/require-nullable-result-in-root/index.d.cts +1 -2
- package/cjs/rules/require-nullable-result-in-root/index.js +2 -1
- package/cjs/rules/require-selections/index.d.cts +1 -1
- package/cjs/rules/require-selections/index.js +8 -4
- package/cjs/rules/require-type-pattern-with-oneof/index.d.cts +1 -2
- package/cjs/rules/require-type-pattern-with-oneof/index.js +1 -1
- package/cjs/rules/selection-set-depth/index.d.cts +1 -1
- package/cjs/rules/selection-set-depth/index.js +3 -1
- package/cjs/rules/strict-id-in-types/index.d.cts +1 -1
- package/cjs/rules/strict-id-in-types/index.js +5 -5
- package/cjs/rules/unique-enum-value-names/index.d.cts +1 -2
- package/cjs/rules/unique-enum-value-names/index.js +2 -1
- package/cjs/rules/unique-fragment-name/index.d.cts +0 -1
- package/cjs/rules/unique-fragment-name/index.js +1 -2
- package/cjs/rules/unique-operation-name/index.d.cts +1 -2
- package/cjs/rules/unique-operation-name/index.js +1 -1
- package/cjs/schema.d.cts +1 -2
- package/cjs/types.d.cts +7 -17
- package/cjs/utils.d.cts +2 -2
- package/cjs/utils.js +5 -1
- package/esm/graphql-config.d.ts +1 -2
- package/esm/index.d.ts +0 -1
- package/esm/meta.js +1 -1
- package/esm/parser.d.ts +1 -2
- package/esm/rules/alphabetize/index.d.ts +1 -1
- package/esm/rules/alphabetize/index.js +2 -1
- package/esm/rules/description-style/index.d.ts +1 -1
- package/esm/rules/description-style/index.js +3 -1
- package/esm/rules/graphql-js-validation.d.ts +1 -2
- package/esm/rules/graphql-js-validation.js +31 -30
- package/esm/rules/index.d.ts +0 -1
- package/esm/rules/input-name/index.d.ts +1 -1
- package/esm/rules/input-name/index.js +3 -1
- package/esm/rules/lone-executable-definition/index.d.ts +1 -1
- package/esm/rules/lone-executable-definition/index.js +2 -1
- package/esm/rules/match-document-filename/index.d.ts +1 -1
- package/esm/rules/match-document-filename/index.js +2 -1
- package/esm/rules/naming-convention/index.d.ts +1 -1
- package/esm/rules/naming-convention/index.js +3 -1
- package/esm/rules/no-anonymous-operations/index.d.ts +1 -2
- package/esm/rules/no-anonymous-operations/index.js +2 -1
- package/esm/rules/no-deprecated/index.d.ts +1 -2
- package/esm/rules/no-deprecated/index.js +2 -1
- package/esm/rules/no-duplicate-fields/index.d.ts +1 -2
- package/esm/rules/no-duplicate-fields/index.js +2 -1
- package/esm/rules/no-hashtag-description/index.d.ts +1 -2
- package/esm/rules/no-hashtag-description/index.js +2 -1
- package/esm/rules/no-one-place-fragments/index.d.ts +1 -2
- package/esm/rules/no-one-place-fragments/index.js +1 -1
- package/esm/rules/no-root-type/index.d.ts +1 -1
- package/esm/rules/no-root-type/index.js +3 -1
- package/esm/rules/no-scalar-result-type-on-mutation/index.d.ts +1 -2
- package/esm/rules/no-scalar-result-type-on-mutation/index.js +2 -1
- package/esm/rules/no-typename-prefix/index.d.ts +1 -2
- package/esm/rules/no-typename-prefix/index.js +2 -1
- package/esm/rules/no-unreachable-types/index.d.ts +1 -2
- package/esm/rules/no-unreachable-types/index.js +2 -1
- package/esm/rules/no-unused-fields/index.d.ts +1 -1
- package/esm/rules/no-unused-fields/index.js +2 -1
- package/esm/rules/relay-arguments/index.d.ts +1 -1
- package/esm/rules/relay-arguments/index.js +1 -1
- package/esm/rules/relay-connection-types/index.d.ts +1 -2
- package/esm/rules/relay-connection-types/index.js +1 -1
- package/esm/rules/relay-edge-types/index.d.ts +1 -1
- package/esm/rules/relay-edge-types/index.js +1 -1
- package/esm/rules/relay-page-info/index.d.ts +1 -2
- package/esm/rules/relay-page-info/index.js +1 -1
- package/esm/rules/require-deprecation-date/index.d.ts +1 -1
- package/esm/rules/require-deprecation-date/index.js +2 -1
- package/esm/rules/require-deprecation-reason/index.d.ts +1 -2
- package/esm/rules/require-deprecation-reason/index.js +1 -1
- package/esm/rules/require-description/index.d.ts +1 -1
- package/esm/rules/require-description/index.js +2 -1
- package/esm/rules/require-field-of-type-query-in-mutation-result/index.d.ts +1 -2
- package/esm/rules/require-field-of-type-query-in-mutation-result/index.js +1 -1
- package/esm/rules/require-import-fragment/index.d.ts +1 -2
- package/esm/rules/require-import-fragment/index.js +2 -1
- package/esm/rules/require-nullable-fields-with-oneof/index.d.ts +1 -2
- package/esm/rules/require-nullable-fields-with-oneof/index.js +1 -1
- package/esm/rules/require-nullable-result-in-root/index.d.ts +1 -2
- package/esm/rules/require-nullable-result-in-root/index.js +2 -1
- package/esm/rules/require-selections/index.d.ts +1 -1
- package/esm/rules/require-selections/index.js +8 -4
- package/esm/rules/require-type-pattern-with-oneof/index.d.ts +1 -2
- package/esm/rules/require-type-pattern-with-oneof/index.js +1 -1
- package/esm/rules/selection-set-depth/index.d.ts +1 -1
- package/esm/rules/selection-set-depth/index.js +3 -1
- package/esm/rules/strict-id-in-types/index.d.ts +1 -1
- package/esm/rules/strict-id-in-types/index.js +5 -5
- package/esm/rules/unique-enum-value-names/index.d.ts +1 -2
- package/esm/rules/unique-enum-value-names/index.js +2 -1
- package/esm/rules/unique-fragment-name/index.d.ts +0 -1
- package/esm/rules/unique-fragment-name/index.js +1 -2
- package/esm/rules/unique-operation-name/index.d.ts +1 -2
- package/esm/rules/unique-operation-name/index.js +1 -1
- package/esm/schema.d.ts +1 -2
- package/esm/types.d.ts +7 -17
- package/esm/utils.d.ts +2 -2
- package/esm/utils.js +4 -0
- package/package.json +11 -1
- package/{index.browser.js → programmatic.js} +104 -73
@@ -2,9 +2,9 @@ import { OperationTypeNode } from 'graphql';
|
|
2
2
|
import { FromSchema } from 'json-schema-to-ts';
|
3
3
|
import { GraphQLESLintRule } from '../../types.js';
|
4
4
|
import 'eslint';
|
5
|
-
import 'estree';
|
6
5
|
import 'graphql-config';
|
7
6
|
import '../../estree-converter/types.js';
|
7
|
+
import 'estree';
|
8
8
|
import '../../siblings.js';
|
9
9
|
import '@graphql-tools/utils';
|
10
10
|
|
@@ -26,7 +26,7 @@ const rule = {
|
|
26
26
|
meta: {
|
27
27
|
type: "suggestion",
|
28
28
|
docs: {
|
29
|
-
category: "
|
29
|
+
category: "operations",
|
30
30
|
description: "Require queries, mutations, subscriptions or fragments to be located in separate files.",
|
31
31
|
url: `https://the-guild.dev/graphql/eslint/rules/${RULE_ID}`,
|
32
32
|
examples: [
|
@@ -60,6 +60,7 @@ const rule = {
|
|
60
60
|
messages: {
|
61
61
|
[RULE_ID]: "{{name}} should be in a separate file."
|
62
62
|
},
|
63
|
+
// @ts-expect-error -- fixme
|
63
64
|
schema
|
64
65
|
},
|
65
66
|
create(context) {
|
@@ -2,10 +2,10 @@ import { FromSchema } from 'json-schema-to-ts';
|
|
2
2
|
import { GraphQLESLintRule } from '../../types.js';
|
3
3
|
import { CaseStyle as CaseStyle$1 } from '../../utils.js';
|
4
4
|
import 'eslint';
|
5
|
-
import 'estree';
|
6
5
|
import 'graphql';
|
7
6
|
import 'graphql-config';
|
8
7
|
import '../../estree-converter/types.js';
|
8
|
+
import 'estree';
|
9
9
|
import '../../siblings.js';
|
10
10
|
import '@graphql-tools/utils';
|
11
11
|
|
@@ -56,7 +56,7 @@ const rule = {
|
|
56
56
|
meta: {
|
57
57
|
type: "suggestion",
|
58
58
|
docs: {
|
59
|
-
category: "
|
59
|
+
category: "operations",
|
60
60
|
description: "This rule allows you to enforce that the file name should match the operation name.",
|
61
61
|
url: "https://the-guild.dev/graphql/eslint/rules/match-document-filename",
|
62
62
|
examples: [
|
@@ -187,6 +187,7 @@ const rule = {
|
|
187
187
|
[MATCH_EXTENSION]: `File extension "{{ fileExtension }}" don't match extension "{{ expectedFileExtension }}"`,
|
188
188
|
[MATCH_STYLE]: 'Unexpected filename "{{ filename }}". Rename it to "{{ expectedFilename }}"'
|
189
189
|
},
|
190
|
+
// @ts-expect-error -- fixme
|
190
191
|
schema
|
191
192
|
},
|
192
193
|
create(context) {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { FromSchema } from 'json-schema-to-ts';
|
2
2
|
import { GraphQLESLintRule } from '../../types.js';
|
3
3
|
import 'eslint';
|
4
|
-
import 'estree';
|
5
4
|
import 'graphql';
|
6
5
|
import 'graphql-config';
|
7
6
|
import '../../estree-converter/types.js';
|
7
|
+
import 'estree';
|
8
8
|
import '../../siblings.js';
|
9
9
|
import '@graphql-tools/utils';
|
10
10
|
|
@@ -135,7 +135,7 @@ const rule = {
|
|
135
135
|
type: "suggestion",
|
136
136
|
docs: {
|
137
137
|
description: "Require names to follow specified conventions.",
|
138
|
-
category:
|
138
|
+
category: "schema-and-operations",
|
139
139
|
recommended: true,
|
140
140
|
url: "https://the-guild.dev/graphql/eslint/rules/naming-convention",
|
141
141
|
examples: [
|
@@ -361,6 +361,7 @@ const rule = {
|
|
361
361
|
}
|
362
362
|
},
|
363
363
|
hasSuggestions: true,
|
364
|
+
// @ts-expect-error -- fixme
|
364
365
|
schema
|
365
366
|
},
|
366
367
|
create(context) {
|
@@ -377,6 +378,7 @@ const rule = {
|
|
377
378
|
message,
|
378
379
|
suggest: suggestedNames.map((suggestedName) => ({
|
379
380
|
desc: `Rename to \`${suggestedName}\``,
|
381
|
+
// @ts-expect-error -- fixme
|
380
382
|
fix: (fixer) => fixer.replaceText(node, suggestedName)
|
381
383
|
}))
|
382
384
|
});
|
@@ -1,10 +1,9 @@
|
|
1
1
|
import { GraphQLESLintRule } from '../../types.js';
|
2
2
|
import 'eslint';
|
3
|
-
import 'estree';
|
4
3
|
import 'graphql';
|
5
4
|
import 'graphql-config';
|
6
|
-
import 'json-schema-to-ts';
|
7
5
|
import '../../estree-converter/types.js';
|
6
|
+
import 'estree';
|
8
7
|
import '../../siblings.js';
|
9
8
|
import '@graphql-tools/utils';
|
10
9
|
|
@@ -6,7 +6,7 @@ const rule = {
|
|
6
6
|
type: "suggestion",
|
7
7
|
hasSuggestions: true,
|
8
8
|
docs: {
|
9
|
-
category: "
|
9
|
+
category: "operations",
|
10
10
|
description: "Require name for your GraphQL operations. This is useful since most GraphQL client libraries are using the operation name for caching purposes.",
|
11
11
|
recommended: true,
|
12
12
|
url: `https://the-guild.dev/graphql/eslint/rules/${RULE_ID}`,
|
@@ -54,6 +54,7 @@ const rule = {
|
|
54
54
|
suggest: [
|
55
55
|
{
|
56
56
|
desc: `Rename to \`${suggestedName}\``,
|
57
|
+
// @ts-expect-error -- fixme
|
57
58
|
fix(fixer) {
|
58
59
|
const sourceCode = context.getSourceCode();
|
59
60
|
const hasQueryKeyword = sourceCode.getText({ range: [node.range[0], node.range[0] + 1] }) !== "{";
|
@@ -1,10 +1,9 @@
|
|
1
1
|
import { GraphQLESLintRule } from '../../types.js';
|
2
2
|
import 'eslint';
|
3
|
-
import 'estree';
|
4
3
|
import 'graphql';
|
5
4
|
import 'graphql-config';
|
6
|
-
import 'json-schema-to-ts';
|
7
5
|
import '../../estree-converter/types.js';
|
6
|
+
import 'estree';
|
8
7
|
import '../../siblings.js';
|
9
8
|
import '@graphql-tools/utils';
|
10
9
|
|
@@ -5,7 +5,7 @@ const rule = {
|
|
5
5
|
type: "suggestion",
|
6
6
|
hasSuggestions: true,
|
7
7
|
docs: {
|
8
|
-
category: "
|
8
|
+
category: "operations",
|
9
9
|
description: "Enforce that deprecated fields or enum values are not in use by operations.",
|
10
10
|
url: `https://the-guild.dev/graphql/eslint/rules/${RULE_ID}`,
|
11
11
|
requiresSchema: true,
|
@@ -101,6 +101,7 @@ const rule = {
|
|
101
101
|
suggest: [
|
102
102
|
{
|
103
103
|
desc: `Remove ${nodeType}`,
|
104
|
+
// @ts-expect-error -- fixme
|
104
105
|
fix: (fixer) => fixer.remove(node)
|
105
106
|
}
|
106
107
|
]
|
@@ -1,10 +1,9 @@
|
|
1
1
|
import { GraphQLESLintRule } from '../../types.js';
|
2
2
|
import 'eslint';
|
3
|
-
import 'estree';
|
4
3
|
import 'graphql';
|
5
4
|
import 'graphql-config';
|
6
|
-
import 'json-schema-to-ts';
|
7
5
|
import '../../estree-converter/types.js';
|
6
|
+
import 'estree';
|
8
7
|
import '../../siblings.js';
|
9
8
|
import '@graphql-tools/utils';
|
10
9
|
|
@@ -6,7 +6,7 @@ const rule = {
|
|
6
6
|
hasSuggestions: true,
|
7
7
|
docs: {
|
8
8
|
description: "Checks for duplicate fields in selection set, variables in operation definition, or in arguments set of a field.",
|
9
|
-
category: "
|
9
|
+
category: "operations",
|
10
10
|
url: `https://the-guild.dev/graphql/eslint/rules/${RULE_ID}`,
|
11
11
|
recommended: true,
|
12
12
|
examples: [
|
@@ -81,6 +81,7 @@ const rule = {
|
|
81
81
|
suggest: [
|
82
82
|
{
|
83
83
|
desc: `Remove \`${fieldName}\` ${parent.type.toLowerCase()}`,
|
84
|
+
// @ts-expect-error -- fixme
|
84
85
|
fix(fixer) {
|
85
86
|
return fixer.remove(
|
86
87
|
parent.type === Kind.VARIABLE ? parent.parent : parent
|
@@ -1,10 +1,9 @@
|
|
1
1
|
import { GraphQLESLintRule } from '../../types.js';
|
2
2
|
import 'eslint';
|
3
|
-
import 'estree';
|
4
3
|
import 'graphql';
|
5
4
|
import 'graphql-config';
|
6
|
-
import 'json-schema-to-ts';
|
7
5
|
import '../../estree-converter/types.js';
|
6
|
+
import 'estree';
|
8
7
|
import '../../siblings.js';
|
9
8
|
import '@graphql-tools/utils';
|
10
9
|
|
@@ -11,7 +11,7 @@ const rule = {
|
|
11
11
|
},
|
12
12
|
docs: {
|
13
13
|
description: 'Requires to use `"""` or `"` for adding a GraphQL description instead of `#`.\nAllows to use hashtag for comments, as long as it\'s not attached to an AST definition.',
|
14
|
-
category: "
|
14
|
+
category: "schema",
|
15
15
|
url: "https://the-guild.dev/graphql/eslint/rules/no-hashtag-description",
|
16
16
|
examples: [
|
17
17
|
{
|
@@ -91,6 +91,7 @@ const rule = {
|
|
91
91
|
},
|
92
92
|
suggest: ['"""', '"'].map((descriptionSyntax) => ({
|
93
93
|
desc: `Replace with \`${descriptionSyntax}\` description syntax`,
|
94
|
+
// @ts-expect-error -- fixme
|
94
95
|
fix: (fixer) => fixer.replaceTextRange(
|
95
96
|
[token.start, token.end],
|
96
97
|
[descriptionSyntax, value.trim(), descriptionSyntax].join("")
|
@@ -1,10 +1,9 @@
|
|
1
1
|
import { GraphQLESLintRule } from '../../types.js';
|
2
2
|
import 'eslint';
|
3
|
-
import 'estree';
|
4
3
|
import 'graphql';
|
5
4
|
import 'graphql-config';
|
6
|
-
import 'json-schema-to-ts';
|
7
5
|
import '../../estree-converter/types.js';
|
6
|
+
import 'estree';
|
8
7
|
import '../../siblings.js';
|
9
8
|
import '@graphql-tools/utils';
|
10
9
|
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { FromSchema } from 'json-schema-to-ts';
|
2
2
|
import { GraphQLESLintRule } from '../../types.js';
|
3
3
|
import 'eslint';
|
4
|
-
import 'estree';
|
5
4
|
import 'graphql';
|
6
5
|
import 'graphql-config';
|
7
6
|
import '../../estree-converter/types.js';
|
7
|
+
import 'estree';
|
8
8
|
import '../../siblings.js';
|
9
9
|
import '@graphql-tools/utils';
|
10
10
|
|
@@ -22,7 +22,7 @@ const rule = {
|
|
22
22
|
type: "suggestion",
|
23
23
|
hasSuggestions: true,
|
24
24
|
docs: {
|
25
|
-
category: "
|
25
|
+
category: "schema",
|
26
26
|
description: "Disallow using root types `mutation` and/or `subscription`.",
|
27
27
|
url: "https://the-guild.dev/graphql/eslint/rules/no-root-type",
|
28
28
|
requiresSchema: true,
|
@@ -54,6 +54,7 @@ const rule = {
|
|
54
54
|
],
|
55
55
|
configOptions: [{ disallow: ["mutation", "subscription"] }]
|
56
56
|
},
|
57
|
+
// @ts-expect-error -- fixme
|
57
58
|
schema
|
58
59
|
},
|
59
60
|
create(context) {
|
@@ -76,6 +77,7 @@ const rule = {
|
|
76
77
|
suggest: [
|
77
78
|
{
|
78
79
|
desc: `Remove \`${typeName}\` type`,
|
80
|
+
// @ts-expect-error -- fixme
|
79
81
|
fix: (fixer) => fixer.remove(node.parent)
|
80
82
|
}
|
81
83
|
]
|
@@ -1,10 +1,9 @@
|
|
1
1
|
import { GraphQLESLintRule } from '../../types.js';
|
2
2
|
import 'eslint';
|
3
|
-
import 'estree';
|
4
3
|
import 'graphql';
|
5
4
|
import 'graphql-config';
|
6
|
-
import 'json-schema-to-ts';
|
7
5
|
import '../../estree-converter/types.js';
|
6
|
+
import 'estree';
|
8
7
|
import '../../siblings.js';
|
9
8
|
import '@graphql-tools/utils';
|
10
9
|
|
@@ -6,7 +6,7 @@ const rule = {
|
|
6
6
|
type: "suggestion",
|
7
7
|
hasSuggestions: true,
|
8
8
|
docs: {
|
9
|
-
category: "
|
9
|
+
category: "schema",
|
10
10
|
description: "Avoid scalar result type on mutation type to make sure to return a valid state.",
|
11
11
|
url: `https://the-guild.dev/graphql/eslint/rules/${RULE_ID}`,
|
12
12
|
requiresSchema: true,
|
@@ -62,6 +62,7 @@ const rule = {
|
|
62
62
|
suggest: [
|
63
63
|
{
|
64
64
|
desc: `Remove \`${typeName}\``,
|
65
|
+
// @ts-expect-error -- fixme
|
65
66
|
fix: (fixer) => fixer.remove(node)
|
66
67
|
}
|
67
68
|
]
|
@@ -1,10 +1,9 @@
|
|
1
1
|
import { GraphQLESLintRule } from '../../types.js';
|
2
2
|
import 'eslint';
|
3
|
-
import 'estree';
|
4
3
|
import 'graphql';
|
5
4
|
import 'graphql-config';
|
6
|
-
import 'json-schema-to-ts';
|
7
5
|
import '../../estree-converter/types.js';
|
6
|
+
import 'estree';
|
8
7
|
import '../../siblings.js';
|
9
8
|
import '@graphql-tools/utils';
|
10
9
|
|
@@ -4,7 +4,7 @@ const rule = {
|
|
4
4
|
type: "suggestion",
|
5
5
|
hasSuggestions: true,
|
6
6
|
docs: {
|
7
|
-
category: "
|
7
|
+
category: "schema",
|
8
8
|
description: "Enforces users to avoid using the type name in a field name while defining your schema.",
|
9
9
|
recommended: true,
|
10
10
|
url: "https://the-guild.dev/graphql/eslint/rules/no-typename-prefix",
|
@@ -56,6 +56,7 @@ const rule = {
|
|
56
56
|
suggest: [
|
57
57
|
{
|
58
58
|
desc: `Remove \`${fieldName.slice(0, typeName.length)}\` prefix`,
|
59
|
+
// @ts-expect-error -- fixme
|
59
60
|
fix: (fixer) => fixer.replaceText(
|
60
61
|
field.name,
|
61
62
|
fieldName.replace(new RegExp(`^${typeName}`, "i"), "")
|
@@ -1,10 +1,9 @@
|
|
1
1
|
import { GraphQLESLintRule } from '../../types.js';
|
2
2
|
import 'eslint';
|
3
|
-
import 'estree';
|
4
3
|
import 'graphql';
|
5
4
|
import 'graphql-config';
|
6
|
-
import 'json-schema-to-ts';
|
7
5
|
import '../../estree-converter/types.js';
|
6
|
+
import 'estree';
|
8
7
|
import '../../siblings.js';
|
9
8
|
import '@graphql-tools/utils';
|
10
9
|
|
@@ -95,7 +95,7 @@ const rule = {
|
|
95
95
|
},
|
96
96
|
docs: {
|
97
97
|
description: "Requires all types to be reachable at some level by root level fields.",
|
98
|
-
category: "
|
98
|
+
category: "schema",
|
99
99
|
url: `https://the-guild.dev/graphql/eslint/rules/${RULE_ID}`,
|
100
100
|
requiresSchema: true,
|
101
101
|
examples: [
|
@@ -156,6 +156,7 @@ const rule = {
|
|
156
156
|
suggest: [
|
157
157
|
{
|
158
158
|
desc: `Remove \`${typeName}\``,
|
159
|
+
// @ts-expect-error -- fixme
|
159
160
|
fix: (fixer) => fixer.remove(node.parent)
|
160
161
|
}
|
161
162
|
]
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { FromSchema } from 'json-schema-to-ts';
|
2
2
|
import { GraphQLESLintRule } from '../../types.js';
|
3
3
|
import 'eslint';
|
4
|
-
import 'estree';
|
5
4
|
import 'graphql';
|
6
5
|
import 'graphql-config';
|
7
6
|
import '../../estree-converter/types.js';
|
7
|
+
import 'estree';
|
8
8
|
import '../../siblings.js';
|
9
9
|
import '@graphql-tools/utils';
|
10
10
|
|
@@ -130,7 +130,7 @@ const rule = {
|
|
130
130
|
},
|
131
131
|
docs: {
|
132
132
|
description: "Requires all fields to be used at some level by siblings operations.",
|
133
|
-
category: "
|
133
|
+
category: "schema",
|
134
134
|
url: `https://the-guild.dev/graphql/eslint/rules/${RULE_ID}`,
|
135
135
|
requiresSiblings: true,
|
136
136
|
requiresSchema: true,
|
@@ -228,6 +228,7 @@ const rule = {
|
|
228
228
|
suggest: [
|
229
229
|
{
|
230
230
|
desc: `Remove \`${fieldName}\` field`,
|
231
|
+
// @ts-expect-error -- fixme
|
231
232
|
fix(fixer) {
|
232
233
|
const sourceCode = context.getSourceCode();
|
233
234
|
const tokenBefore = sourceCode.getTokenBefore(node);
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { FromSchema } from 'json-schema-to-ts';
|
2
2
|
import { GraphQLESLintRule } from '../../types.js';
|
3
3
|
import 'eslint';
|
4
|
-
import 'estree';
|
5
4
|
import 'graphql';
|
6
5
|
import 'graphql-config';
|
7
6
|
import '../../estree-converter/types.js';
|
7
|
+
import 'estree';
|
8
8
|
import '../../siblings.js';
|
9
9
|
import '@graphql-tools/utils';
|
10
10
|
|
@@ -1,10 +1,9 @@
|
|
1
1
|
import { Kind } from 'graphql';
|
2
2
|
import { GraphQLESLintRule } from '../../types.js';
|
3
3
|
import 'eslint';
|
4
|
-
import 'estree';
|
5
4
|
import 'graphql-config';
|
6
|
-
import 'json-schema-to-ts';
|
7
5
|
import '../../estree-converter/types.js';
|
6
|
+
import 'estree';
|
8
7
|
import '../../siblings.js';
|
9
8
|
import '@graphql-tools/utils';
|
10
9
|
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { FromSchema } from 'json-schema-to-ts';
|
2
2
|
import { GraphQLESLintRule } from '../../types.js';
|
3
3
|
import 'eslint';
|
4
|
-
import 'estree';
|
5
4
|
import 'graphql';
|
6
5
|
import 'graphql-config';
|
7
6
|
import '../../estree-converter/types.js';
|
7
|
+
import 'estree';
|
8
8
|
import '../../siblings.js';
|
9
9
|
import '@graphql-tools/utils';
|
10
10
|
|
@@ -1,10 +1,9 @@
|
|
1
1
|
import { GraphQLESLintRule } from '../../types.js';
|
2
2
|
import 'eslint';
|
3
|
-
import 'estree';
|
4
3
|
import 'graphql';
|
5
4
|
import 'graphql-config';
|
6
|
-
import 'json-schema-to-ts';
|
7
5
|
import '../../estree-converter/types.js';
|
6
|
+
import 'estree';
|
8
7
|
import '../../siblings.js';
|
9
8
|
import '@graphql-tools/utils';
|
10
9
|
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { FromSchema } from 'json-schema-to-ts';
|
2
2
|
import { GraphQLESLintRule } from '../../types.js';
|
3
3
|
import 'eslint';
|
4
|
-
import 'estree';
|
5
4
|
import 'graphql';
|
6
5
|
import 'graphql-config';
|
7
6
|
import '../../estree-converter/types.js';
|
7
|
+
import 'estree';
|
8
8
|
import '../../siblings.js';
|
9
9
|
import '@graphql-tools/utils';
|
10
10
|
|
@@ -23,7 +23,7 @@ const rule = {
|
|
23
23
|
type: "suggestion",
|
24
24
|
hasSuggestions: true,
|
25
25
|
docs: {
|
26
|
-
category: "
|
26
|
+
category: "schema",
|
27
27
|
description: "Require deletion date on `@deprecated` directive. Suggest removing deprecated things after deprecated date.",
|
28
28
|
url: "https://the-guild.dev/graphql/eslint/rules/require-deprecation-date",
|
29
29
|
examples: [
|
@@ -125,6 +125,7 @@ const rule = {
|
|
125
125
|
suggest: [
|
126
126
|
{
|
127
127
|
desc: `Remove \`${nodeName}\``,
|
128
|
+
// @ts-expect-error -- fixme
|
128
129
|
fix: (fixer) => fixer.remove(parent)
|
129
130
|
}
|
130
131
|
]
|
@@ -1,10 +1,9 @@
|
|
1
1
|
import { GraphQLESLintRule } from '../../types.js';
|
2
2
|
import 'eslint';
|
3
|
-
import 'estree';
|
4
3
|
import 'graphql';
|
5
4
|
import 'graphql-config';
|
6
|
-
import 'json-schema-to-ts';
|
7
5
|
import '../../estree-converter/types.js';
|
6
|
+
import 'estree';
|
8
7
|
import '../../siblings.js';
|
9
8
|
import '@graphql-tools/utils';
|
10
9
|
|
@@ -4,7 +4,7 @@ const rule = {
|
|
4
4
|
meta: {
|
5
5
|
docs: {
|
6
6
|
description: "Require all deprecation directives to specify a reason.",
|
7
|
-
category: "
|
7
|
+
category: "schema",
|
8
8
|
url: "https://the-guild.dev/graphql/eslint/rules/require-deprecation-reason",
|
9
9
|
recommended: true,
|
10
10
|
examples: [
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { FromSchema } from 'json-schema-to-ts';
|
2
2
|
import { GraphQLESLintRule } from '../../types.js';
|
3
3
|
import 'eslint';
|
4
|
-
import 'estree';
|
5
4
|
import 'graphql';
|
6
5
|
import 'graphql-config';
|
7
6
|
import '../../estree-converter/types.js';
|
7
|
+
import 'estree';
|
8
8
|
import '../../siblings.js';
|
9
9
|
import '@graphql-tools/utils';
|
10
10
|
|
@@ -64,7 +64,7 @@ ${TYPES_KINDS.map((kind) => `- \`${kind}\``).join("\n")}`
|
|
64
64
|
const rule = {
|
65
65
|
meta: {
|
66
66
|
docs: {
|
67
|
-
category: "
|
67
|
+
category: "schema",
|
68
68
|
description: "Enforce descriptions in type definitions and operations.",
|
69
69
|
url: `https://the-guild.dev/graphql/eslint/rules/${RULE_ID}`,
|
70
70
|
examples: [
|
@@ -172,6 +172,7 @@ const rule = {
|
|
172
172
|
messages: {
|
173
173
|
[RULE_ID]: "Description is required for {{ nodeName }}"
|
174
174
|
},
|
175
|
+
// @ts-expect-error -- fixme
|
175
176
|
schema
|
176
177
|
},
|
177
178
|
create(context) {
|
@@ -1,10 +1,9 @@
|
|
1
1
|
import { GraphQLESLintRule } from '../../types.js';
|
2
2
|
import 'eslint';
|
3
|
-
import 'estree';
|
4
3
|
import 'graphql';
|
5
4
|
import 'graphql-config';
|
6
|
-
import 'json-schema-to-ts';
|
7
5
|
import '../../estree-converter/types.js';
|
6
|
+
import 'estree';
|
8
7
|
import '../../siblings.js';
|
9
8
|
import '@graphql-tools/utils';
|
10
9
|
|
@@ -5,7 +5,7 @@ const rule = {
|
|
5
5
|
meta: {
|
6
6
|
type: "suggestion",
|
7
7
|
docs: {
|
8
|
-
category: "
|
8
|
+
category: "schema",
|
9
9
|
description: "Allow the client in one round-trip not only to call mutation but also to get a wagon of data to update their application.\n> Currently, no errors are reported for result type `union`, `interface` and `scalar`.",
|
10
10
|
url: `https://the-guild.dev/graphql/eslint/rules/${RULE_ID}`,
|
11
11
|
requiresSchema: true,
|
@@ -1,10 +1,9 @@
|
|
1
1
|
import { GraphQLESLintRule } from '../../types.js';
|
2
2
|
import 'eslint';
|
3
|
-
import 'estree';
|
4
3
|
import 'graphql';
|
5
4
|
import 'graphql-config';
|
6
|
-
import 'json-schema-to-ts';
|
7
5
|
import '../../estree-converter/types.js';
|
6
|
+
import 'estree';
|
8
7
|
import '../../siblings.js';
|
9
8
|
import '@graphql-tools/utils';
|
10
9
|
|
@@ -6,7 +6,7 @@ const rule = {
|
|
6
6
|
meta: {
|
7
7
|
type: "suggestion",
|
8
8
|
docs: {
|
9
|
-
category: "
|
9
|
+
category: "operations",
|
10
10
|
description: "Require fragments to be imported via an import expression.",
|
11
11
|
url: `https://the-guild.dev/graphql/eslint/rules/${RULE_ID}`,
|
12
12
|
examples: [
|
@@ -114,6 +114,7 @@ const rule = {
|
|
114
114
|
suggest: suggestedFilePaths.map((suggestedPath) => ({
|
115
115
|
messageId: SUGGESTION_ID,
|
116
116
|
data: { fragmentName },
|
117
|
+
// @ts-expect-error -- fixme
|
117
118
|
fix: (fixer) => fixer.insertTextBeforeRange(
|
118
119
|
[0, 0],
|
119
120
|
`# import ${fragmentName} from '${suggestedPath}'
|
@@ -1,10 +1,9 @@
|
|
1
1
|
import { GraphQLESLintRule } from '../../types.js';
|
2
2
|
import 'eslint';
|
3
|
-
import 'estree';
|
4
3
|
import 'graphql';
|
5
4
|
import 'graphql-config';
|
6
|
-
import 'json-schema-to-ts';
|
7
5
|
import '../../estree-converter/types.js';
|
6
|
+
import 'estree';
|
8
7
|
import '../../siblings.js';
|
9
8
|
import '@graphql-tools/utils';
|
10
9
|
|