@graphql-eslint/eslint-plugin 3.0.0-alpha-069461d.0 → 3.0.0-alpha-698204a.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 (88) hide show
  1. package/README.md +19 -8
  2. package/configs/base.d.ts +5 -0
  3. package/configs/index.d.ts +59 -91
  4. package/configs/operations-all.d.ts +19 -0
  5. package/configs/{recommended.d.ts → operations-recommended.d.ts} +11 -30
  6. package/configs/schema-all.d.ts +23 -0
  7. package/configs/schema-recommended.d.ts +44 -0
  8. package/docs/README.md +9 -17
  9. package/docs/deprecated-rules.md +21 -0
  10. package/docs/rules/alphabetize.md +1 -1
  11. package/docs/rules/description-style.md +4 -2
  12. package/docs/rules/executable-definitions.md +2 -2
  13. package/docs/rules/fields-on-correct-type.md +2 -2
  14. package/docs/rules/fragments-on-composite-type.md +2 -2
  15. package/docs/rules/input-name.md +1 -1
  16. package/docs/rules/known-argument-names.md +2 -2
  17. package/docs/rules/known-directives.md +2 -2
  18. package/docs/rules/known-fragment-names.md +2 -2
  19. package/docs/rules/known-type-names.md +2 -2
  20. package/docs/rules/lone-anonymous-operation.md +2 -2
  21. package/docs/rules/lone-schema-definition.md +2 -2
  22. package/docs/rules/match-document-filename.md +6 -4
  23. package/docs/rules/naming-convention.md +26 -27
  24. package/docs/rules/no-anonymous-operations.md +2 -2
  25. package/docs/rules/no-case-insensitive-enum-values-duplicates.md +2 -2
  26. package/docs/rules/no-deprecated.md +3 -1
  27. package/docs/rules/{avoid-duplicate-fields.md → no-duplicate-fields.md} +10 -8
  28. package/docs/rules/no-fragment-cycles.md +2 -2
  29. package/docs/rules/no-hashtag-description.md +3 -1
  30. package/docs/rules/no-root-type.md +7 -1
  31. package/docs/rules/{avoid-scalar-result-type-on-mutation.md → no-scalar-result-type-on-mutation.md} +7 -7
  32. package/docs/rules/no-typename-prefix.md +37 -0
  33. package/docs/rules/no-undefined-variables.md +2 -2
  34. package/docs/rules/no-unreachable-types.md +3 -1
  35. package/docs/rules/no-unused-fields.md +1 -1
  36. package/docs/rules/no-unused-fragments.md +2 -2
  37. package/docs/rules/no-unused-variables.md +2 -2
  38. package/docs/rules/one-field-subscriptions.md +2 -2
  39. package/docs/rules/overlapping-fields-can-be-merged.md +2 -2
  40. package/docs/rules/possible-fragment-spread.md +2 -2
  41. package/docs/rules/possible-type-extension.md +2 -2
  42. package/docs/rules/provided-required-arguments.md +2 -2
  43. package/docs/rules/require-deprecation-date.md +1 -1
  44. package/docs/rules/require-deprecation-reason.md +2 -2
  45. package/docs/rules/require-description.md +36 -7
  46. package/docs/rules/require-field-of-type-query-in-mutation-result.md +1 -1
  47. package/docs/rules/require-id-when-available.md +3 -1
  48. package/docs/rules/scalar-leafs.md +2 -2
  49. package/docs/rules/selection-set-depth.md +9 -2
  50. package/docs/rules/strict-id-in-types.md +16 -10
  51. package/docs/rules/unique-argument-names.md +2 -2
  52. package/docs/rules/unique-directive-names-per-location.md +2 -2
  53. package/docs/rules/unique-directive-names.md +2 -2
  54. package/docs/rules/unique-enum-value-names.md +2 -2
  55. package/docs/rules/unique-field-definition-names.md +2 -2
  56. package/docs/rules/unique-fragment-name.md +1 -1
  57. package/docs/rules/unique-input-field-names.md +2 -2
  58. package/docs/rules/unique-operation-name.md +1 -1
  59. package/docs/rules/unique-operation-types.md +2 -2
  60. package/docs/rules/unique-type-names.md +2 -2
  61. package/docs/rules/unique-variable-names.md +2 -2
  62. package/docs/rules/value-literals-of-correct-type.md +2 -2
  63. package/docs/rules/variables-are-input-types.md +2 -2
  64. package/docs/rules/variables-in-allowed-position.md +2 -2
  65. package/index.js +566 -599
  66. package/index.mjs +567 -600
  67. package/package.json +1 -1
  68. package/rules/alphabetize.d.ts +8 -10
  69. package/rules/description-style.d.ts +4 -6
  70. package/rules/index.d.ts +18 -8
  71. package/rules/input-name.d.ts +1 -1
  72. package/rules/match-document-filename.d.ts +8 -10
  73. package/rules/naming-convention.d.ts +1 -1
  74. package/rules/{avoid-duplicate-fields.d.ts → no-duplicate-fields.d.ts} +0 -0
  75. package/rules/{avoid-scalar-result-type-on-mutation.d.ts → no-scalar-result-type-on-mutation.d.ts} +0 -0
  76. package/rules/{avoid-typename-prefix.d.ts → no-typename-prefix.d.ts} +0 -0
  77. package/rules/require-description.d.ts +10 -6
  78. package/rules/require-id-when-available.d.ts +3 -3
  79. package/rules/selection-set-depth.d.ts +3 -3
  80. package/rules/strict-id-in-types.d.ts +6 -8
  81. package/types.d.ts +9 -5
  82. package/utils.d.ts +1 -1
  83. package/configs/all.d.ts +0 -99
  84. package/docs/rules/avoid-operation-name-prefix.md +0 -50
  85. package/docs/rules/avoid-typename-prefix.md +0 -37
  86. package/docs/rules/no-operation-name-suffix.md +0 -38
  87. package/rules/avoid-operation-name-prefix.d.ts +0 -9
  88. package/rules/no-operation-name-suffix.d.ts +0 -3
@@ -1,8 +1,8 @@
1
1
  # `known-fragment-names`
2
2
 
3
- ✅ The `"extends": "plugin:@graphql-eslint/recommended"` property in a configuration file enables this rule.
3
+ ✅ The `"extends": "plugin:@graphql-eslint/operations-recommended"` property in a configuration file enables this rule.
4
4
 
5
- - Category: `Validation`
5
+ - Category: `Operations`
6
6
  - Rule name: `@graphql-eslint/known-fragment-names`
7
7
  - Requires GraphQL Schema: `true` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
8
8
  - Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
@@ -1,8 +1,8 @@
1
1
  # `known-type-names`
2
2
 
3
- ✅ The `"extends": "plugin:@graphql-eslint/recommended"` property in a configuration file enables this rule.
3
+ ✅ The `"extends": "plugin:@graphql-eslint/schema-recommended"` and `"plugin:@graphql-eslint/operations-recommended"` property in a configuration file enables this rule.
4
4
 
5
- - Category: `Validation`
5
+ - Category: `Schema & Operations`
6
6
  - Rule name: `@graphql-eslint/known-type-names`
7
7
  - Requires GraphQL Schema: `true` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
8
8
  - Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
@@ -1,8 +1,8 @@
1
1
  # `lone-anonymous-operation`
2
2
 
3
- ✅ The `"extends": "plugin:@graphql-eslint/recommended"` property in a configuration file enables this rule.
3
+ ✅ The `"extends": "plugin:@graphql-eslint/operations-recommended"` property in a configuration file enables this rule.
4
4
 
5
- - Category: `Validation`
5
+ - Category: `Operations`
6
6
  - Rule name: `@graphql-eslint/lone-anonymous-operation`
7
7
  - Requires GraphQL Schema: `true` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
8
8
  - Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
@@ -1,8 +1,8 @@
1
1
  # `lone-schema-definition`
2
2
 
3
- ✅ The `"extends": "plugin:@graphql-eslint/recommended"` property in a configuration file enables this rule.
3
+ ✅ The `"extends": "plugin:@graphql-eslint/schema-recommended"` property in a configuration file enables this rule.
4
4
 
5
- - Category: `Validation`
5
+ - Category: `Schema`
6
6
  - Rule name: `@graphql-eslint/lone-schema-definition`
7
7
  - Requires GraphQL Schema: `false` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
8
8
  - Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
@@ -1,6 +1,6 @@
1
1
  # `match-document-filename`
2
2
 
3
- - Category: `Best Practices`
3
+ - Category: `Operations`
4
4
  - Rule name: `@graphql-eslint/match-document-filename`
5
5
  - Requires GraphQL Schema: `false` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
6
6
  - Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
@@ -88,7 +88,7 @@ query UserById {
88
88
 
89
89
  The schema defines the following properties:
90
90
 
91
- ### `fileExtension` (string, enum)
91
+ ### `fileExtension` (enum)
92
92
 
93
93
  This element must be one of the following enum values:
94
94
 
@@ -129,7 +129,7 @@ The object must be one of the following types:
129
129
 
130
130
  The schema defines the following additional types:
131
131
 
132
- ## `asString` (string)
132
+ ## `asString` (enum)
133
133
 
134
134
  One of: `camelCase`, `PascalCase`, `snake_case`, `UPPER_CASE`, `kebab-case`
135
135
 
@@ -137,7 +137,7 @@ One of: `camelCase`, `PascalCase`, `snake_case`, `UPPER_CASE`, `kebab-case`
137
137
 
138
138
  Properties of the `asObject` object:
139
139
 
140
- ### `style` (string, enum)
140
+ ### `style` (enum)
141
141
 
142
142
  This element must be one of the following enum values:
143
143
 
@@ -147,6 +147,8 @@ This element must be one of the following enum values:
147
147
  - `UPPER_CASE`
148
148
  - `kebab-case`
149
149
 
150
+ ### `suffix` (string)
151
+
150
152
  ## Resources
151
153
 
152
154
  - [Rule source](../../packages/plugin/src/rules/match-document-filename.ts)
@@ -1,8 +1,8 @@
1
1
  # `naming-convention`
2
2
 
3
- ✅ The `"extends": "plugin:@graphql-eslint/recommended"` property in a configuration file enables this rule.
3
+ ✅ The `"extends": "plugin:@graphql-eslint/schema-recommended"` and `"plugin:@graphql-eslint/operations-recommended"` property in a configuration file enables this rule.
4
4
 
5
- - Category: `Best Practices`
5
+ - Category: `Schema & Operations`
6
6
  - Rule name: `@graphql-eslint/naming-convention`
7
7
  - Requires GraphQL Schema: `false` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
8
8
  - Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
@@ -39,12 +39,12 @@ The schema defines the following properties:
39
39
 
40
40
  Includes:
41
41
 
42
- - `ObjectTypeDefinition`
43
- - `InterfaceTypeDefinition`
44
- - `EnumTypeDefinition`
45
- - `ScalarTypeDefinition`
46
- - `InputObjectTypeDefinition`
47
- - `UnionTypeDefinition`
42
+ - [ObjectTypeDefinition](https://spec.graphql.org/October2021/#ObjectTypeDefinition)
43
+ - [InterfaceTypeDefinition](https://spec.graphql.org/October2021/#InterfaceTypeDefinition)
44
+ - [EnumTypeDefinition](https://spec.graphql.org/October2021/#EnumTypeDefinition)
45
+ - [ScalarTypeDefinition](https://spec.graphql.org/October2021/#ScalarTypeDefinition)
46
+ - [InputObjectTypeDefinition](https://spec.graphql.org/October2021/#InputObjectTypeDefinition)
47
+ - [UnionTypeDefinition](https://spec.graphql.org/October2021/#UnionTypeDefinition)
48
48
 
49
49
  The object must be one of the following types:
50
50
 
@@ -55,11 +55,10 @@ The object must be one of the following types:
55
55
 
56
56
  Includes:
57
57
 
58
- - `FieldDefinition`
59
- - `InputValueDefinition`
60
- - `VariableDefinition`
61
- - `Argument`
62
- - `DirectiveDefinition`
58
+ - [FieldDefinition](https://spec.graphql.org/October2021/#FieldDefinition)
59
+ - [InputValueDefinition](https://spec.graphql.org/October2021/#InputValueDefinition)
60
+ - [Argument](https://spec.graphql.org/October2021/#Argument)
61
+ - [DirectiveDefinition](https://spec.graphql.org/October2021/#DirectiveDefinition)
63
62
 
64
63
  The object must be one of the following types:
65
64
 
@@ -78,20 +77,20 @@ Default: `false`
78
77
 
79
78
  May contain the following `ASTNode` names:
80
79
 
81
- - `Argument`
82
- - `DirectiveDefinition`
83
- - `EnumTypeDefinition`
84
- - `EnumValueDefinition`
85
- - `FieldDefinition`
86
- - `FragmentDefinition`
87
- - `InputObjectTypeDefinition`
88
- - `InputValueDefinition`
89
- - `InterfaceTypeDefinition`
90
- - `ObjectTypeDefinition`
91
- - `OperationDefinition`
92
- - `ScalarTypeDefinition`
93
- - `UnionTypeDefinition`
94
- - `VariableDefinition`
80
+ - [Argument](https://spec.graphql.org/October2021/#Argument)
81
+ - [DirectiveDefinition](https://spec.graphql.org/October2021/#DirectiveDefinition)
82
+ - [EnumTypeDefinition](https://spec.graphql.org/October2021/#EnumTypeDefinition)
83
+ - [EnumValueDefinition](https://spec.graphql.org/October2021/#EnumValueDefinition)
84
+ - [FieldDefinition](https://spec.graphql.org/October2021/#FieldDefinition)
85
+ - [FragmentDefinition](https://spec.graphql.org/October2021/#FragmentDefinition)
86
+ - [InputObjectTypeDefinition](https://spec.graphql.org/October2021/#InputObjectTypeDefinition)
87
+ - [InputValueDefinition](https://spec.graphql.org/October2021/#InputValueDefinition)
88
+ - [InterfaceTypeDefinition](https://spec.graphql.org/October2021/#InterfaceTypeDefinition)
89
+ - [ObjectTypeDefinition](https://spec.graphql.org/October2021/#ObjectTypeDefinition)
90
+ - [OperationDefinition](https://spec.graphql.org/October2021/#OperationDefinition)
91
+ - [ScalarTypeDefinition](https://spec.graphql.org/October2021/#ScalarTypeDefinition)
92
+ - [UnionTypeDefinition](https://spec.graphql.org/October2021/#UnionTypeDefinition)
93
+ - [VariableDefinition](https://spec.graphql.org/October2021/#VariableDefinition)
95
94
 
96
95
  > It's also possible to use a [`selector`](https://eslint.org/docs/developer-guide/selectors) that starts with `ASTNode` name
97
96
  >
@@ -1,8 +1,8 @@
1
1
  # `no-anonymous-operations`
2
2
 
3
- ✅ The `"extends": "plugin:@graphql-eslint/recommended"` property in a configuration file enables this rule.
3
+ ✅ The `"extends": "plugin:@graphql-eslint/operations-recommended"` property in a configuration file enables this rule.
4
4
 
5
- - Category: `Best Practices`
5
+ - Category: `Operations`
6
6
  - Rule name: `@graphql-eslint/no-anonymous-operations`
7
7
  - Requires GraphQL Schema: `false` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
8
8
  - Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
@@ -1,10 +1,10 @@
1
1
  # `no-case-insensitive-enum-values-duplicates`
2
2
 
3
- ✅ The `"extends": "plugin:@graphql-eslint/recommended"` property in a configuration file enables this rule.
3
+ ✅ The `"extends": "plugin:@graphql-eslint/schema-recommended"` property in a configuration file enables this rule.
4
4
 
5
5
  🔧 The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#--fix) can automatically fix some of the problems reported by this rule.
6
6
 
7
- - Category: `Best Practices`
7
+ - Category: `Schema`
8
8
  - Rule name: `@graphql-eslint/no-case-insensitive-enum-values-duplicates`
9
9
  - Requires GraphQL Schema: `false` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
10
10
  - Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
@@ -1,6 +1,8 @@
1
1
  # `no-deprecated`
2
2
 
3
- - Category: `Best Practices`
3
+ The `"extends": "plugin:@graphql-eslint/operations-recommended"` property in a configuration file enables this rule.
4
+
5
+ - Category: `Operations`
4
6
  - Rule name: `@graphql-eslint/no-deprecated`
5
7
  - Requires GraphQL Schema: `true` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
6
8
  - Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
@@ -1,7 +1,9 @@
1
- # `avoid-duplicate-fields`
1
+ # `no-duplicate-fields`
2
2
 
3
- - Category: `Stylistic Issues`
4
- - Rule name: `@graphql-eslint/avoid-duplicate-fields`
3
+ The `"extends": "plugin:@graphql-eslint/operations-recommended"` property in a configuration file enables this rule.
4
+
5
+ - Category: `Operations`
6
+ - Rule name: `@graphql-eslint/no-duplicate-fields`
5
7
  - Requires GraphQL Schema: `false` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
6
8
  - Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
7
9
 
@@ -12,7 +14,7 @@ Checks for duplicate fields in selection set, variables in operation definition,
12
14
  ### Incorrect
13
15
 
14
16
  ```graphql
15
- # eslint @graphql-eslint/avoid-duplicate-fields: 'error'
17
+ # eslint @graphql-eslint/no-duplicate-fields: 'error'
16
18
 
17
19
  query {
18
20
  user {
@@ -26,7 +28,7 @@ query {
26
28
  ### Incorrect
27
29
 
28
30
  ```graphql
29
- # eslint @graphql-eslint/avoid-duplicate-fields: 'error'
31
+ # eslint @graphql-eslint/no-duplicate-fields: 'error'
30
32
 
31
33
  query {
32
34
  users(
@@ -43,7 +45,7 @@ query {
43
45
  ### Incorrect
44
46
 
45
47
  ```graphql
46
- # eslint @graphql-eslint/avoid-duplicate-fields: 'error'
48
+ # eslint @graphql-eslint/no-duplicate-fields: 'error'
47
49
 
48
50
  query (
49
51
  $first: Int!
@@ -57,5 +59,5 @@ query (
57
59
 
58
60
  ## Resources
59
61
 
60
- - [Rule source](../../packages/plugin/src/rules/avoid-duplicate-fields.ts)
61
- - [Test source](../../packages/plugin/tests/avoid-duplicate-fields.spec.ts)
62
+ - [Rule source](../../packages/plugin/src/rules/no-duplicate-fields.ts)
63
+ - [Test source](../../packages/plugin/tests/no-duplicate-fields.spec.ts)
@@ -1,8 +1,8 @@
1
1
  # `no-fragment-cycles`
2
2
 
3
- ✅ The `"extends": "plugin:@graphql-eslint/recommended"` property in a configuration file enables this rule.
3
+ ✅ The `"extends": "plugin:@graphql-eslint/operations-recommended"` property in a configuration file enables this rule.
4
4
 
5
- - Category: `Validation`
5
+ - Category: `Operations`
6
6
  - Rule name: `@graphql-eslint/no-fragment-cycles`
7
7
  - Requires GraphQL Schema: `true` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
8
8
  - Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
@@ -1,6 +1,8 @@
1
1
  # `no-hashtag-description`
2
2
 
3
- - Category: `Best Practices`
3
+ The `"extends": "plugin:@graphql-eslint/schema-recommended"` property in a configuration file enables this rule.
4
+
5
+ - Category: `Schema`
4
6
  - Rule name: `@graphql-eslint/no-hashtag-description`
5
7
  - Requires GraphQL Schema: `false` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
6
8
  - Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
@@ -1,6 +1,6 @@
1
1
  # `no-root-type`
2
2
 
3
- - Category: `Validation`
3
+ - Category: `Schema`
4
4
  - Rule name: `@graphql-eslint/no-root-type`
5
5
  - Requires GraphQL Schema: `true` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
6
6
  - Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
@@ -45,6 +45,12 @@ The schema defines the following properties:
45
45
 
46
46
  ### `disallow` (array, required)
47
47
 
48
+ The elements of the array can contain the following enum values:
49
+
50
+ - `query`
51
+ - `mutation`
52
+ - `subscription`
53
+
48
54
  Additional restrictions:
49
55
 
50
56
  * Minimum items: `1`
@@ -1,7 +1,7 @@
1
- # `avoid-scalar-result-type-on-mutation`
1
+ # `no-scalar-result-type-on-mutation`
2
2
 
3
- - Category: `Best Practices`
4
- - Rule name: `@graphql-eslint/avoid-scalar-result-type-on-mutation`
3
+ - Category: `Schema`
4
+ - Rule name: `@graphql-eslint/no-scalar-result-type-on-mutation`
5
5
  - Requires GraphQL Schema: `true` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
6
6
  - Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
7
7
 
@@ -12,7 +12,7 @@ Avoid scalar result type on mutation type to make sure to return a valid state.
12
12
  ### Incorrect
13
13
 
14
14
  ```graphql
15
- # eslint @graphql-eslint/avoid-scalar-result-type-on-mutation: 'error'
15
+ # eslint @graphql-eslint/no-scalar-result-type-on-mutation: 'error'
16
16
 
17
17
  type Mutation {
18
18
  createUser: Boolean
@@ -22,7 +22,7 @@ type Mutation {
22
22
  ### Correct
23
23
 
24
24
  ```graphql
25
- # eslint @graphql-eslint/avoid-scalar-result-type-on-mutation: 'error'
25
+ # eslint @graphql-eslint/no-scalar-result-type-on-mutation: 'error'
26
26
 
27
27
  type Mutation {
28
28
  createUser: User!
@@ -31,5 +31,5 @@ type Mutation {
31
31
 
32
32
  ## Resources
33
33
 
34
- - [Rule source](../../packages/plugin/src/rules/avoid-scalar-result-type-on-mutation.ts)
35
- - [Test source](../../packages/plugin/tests/avoid-scalar-result-type-on-mutation.spec.ts)
34
+ - [Rule source](../../packages/plugin/src/rules/no-scalar-result-type-on-mutation.ts)
35
+ - [Test source](../../packages/plugin/tests/no-scalar-result-type-on-mutation.spec.ts)
@@ -0,0 +1,37 @@
1
+ # `no-typename-prefix`
2
+
3
+ ✅ The `"extends": "plugin:@graphql-eslint/schema-recommended"` property in a configuration file enables this rule.
4
+
5
+ - Category: `Schema`
6
+ - Rule name: `@graphql-eslint/no-typename-prefix`
7
+ - Requires GraphQL Schema: `false` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
8
+ - Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
9
+
10
+ Enforces users to avoid using the type name in a field name while defining your schema.
11
+
12
+ ## Usage Examples
13
+
14
+ ### Incorrect
15
+
16
+ ```graphql
17
+ # eslint @graphql-eslint/no-typename-prefix: 'error'
18
+
19
+ type User {
20
+ userId: ID!
21
+ }
22
+ ```
23
+
24
+ ### Correct
25
+
26
+ ```graphql
27
+ # eslint @graphql-eslint/no-typename-prefix: 'error'
28
+
29
+ type User {
30
+ id: ID!
31
+ }
32
+ ```
33
+
34
+ ## Resources
35
+
36
+ - [Rule source](../../packages/plugin/src/rules/no-typename-prefix.ts)
37
+ - [Test source](../../packages/plugin/tests/no-typename-prefix.spec.ts)
@@ -1,8 +1,8 @@
1
1
  # `no-undefined-variables`
2
2
 
3
- ✅ The `"extends": "plugin:@graphql-eslint/recommended"` property in a configuration file enables this rule.
3
+ ✅ The `"extends": "plugin:@graphql-eslint/operations-recommended"` property in a configuration file enables this rule.
4
4
 
5
- - Category: `Validation`
5
+ - Category: `Operations`
6
6
  - Rule name: `@graphql-eslint/no-undefined-variables`
7
7
  - Requires GraphQL Schema: `true` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
8
8
  - Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
@@ -1,8 +1,10 @@
1
1
  # `no-unreachable-types`
2
2
 
3
+ ✅ The `"extends": "plugin:@graphql-eslint/schema-recommended"` property in a configuration file enables this rule.
4
+
3
5
  🔧 The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#--fix) can automatically fix some of the problems reported by this rule.
4
6
 
5
- - Category: `Best Practices`
7
+ - Category: `Schema`
6
8
  - Rule name: `@graphql-eslint/no-unreachable-types`
7
9
  - Requires GraphQL Schema: `true` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
8
10
  - Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
@@ -2,7 +2,7 @@
2
2
 
3
3
  🔧 The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#--fix) can automatically fix some of the problems reported by this rule.
4
4
 
5
- - Category: `Best Practices`
5
+ - Category: `Schema`
6
6
  - Rule name: `@graphql-eslint/no-unused-fields`
7
7
  - Requires GraphQL Schema: `true` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
8
8
  - Requires GraphQL Operations: `true` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
@@ -1,8 +1,8 @@
1
1
  # `no-unused-fragments`
2
2
 
3
- ✅ The `"extends": "plugin:@graphql-eslint/recommended"` property in a configuration file enables this rule.
3
+ ✅ The `"extends": "plugin:@graphql-eslint/operations-recommended"` property in a configuration file enables this rule.
4
4
 
5
- - Category: `Validation`
5
+ - Category: `Operations`
6
6
  - Rule name: `@graphql-eslint/no-unused-fragments`
7
7
  - Requires GraphQL Schema: `true` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
8
8
  - Requires GraphQL Operations: `true` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
@@ -1,8 +1,8 @@
1
1
  # `no-unused-variables`
2
2
 
3
- ✅ The `"extends": "plugin:@graphql-eslint/recommended"` property in a configuration file enables this rule.
3
+ ✅ The `"extends": "plugin:@graphql-eslint/operations-recommended"` property in a configuration file enables this rule.
4
4
 
5
- - Category: `Validation`
5
+ - Category: `Operations`
6
6
  - Rule name: `@graphql-eslint/no-unused-variables`
7
7
  - Requires GraphQL Schema: `true` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
8
8
  - Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
@@ -1,8 +1,8 @@
1
1
  # `one-field-subscriptions`
2
2
 
3
- ✅ The `"extends": "plugin:@graphql-eslint/recommended"` property in a configuration file enables this rule.
3
+ ✅ The `"extends": "plugin:@graphql-eslint/operations-recommended"` property in a configuration file enables this rule.
4
4
 
5
- - Category: `Validation`
5
+ - Category: `Operations`
6
6
  - Rule name: `@graphql-eslint/one-field-subscriptions`
7
7
  - Requires GraphQL Schema: `true` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
8
8
  - Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
@@ -1,8 +1,8 @@
1
1
  # `overlapping-fields-can-be-merged`
2
2
 
3
- ✅ The `"extends": "plugin:@graphql-eslint/recommended"` property in a configuration file enables this rule.
3
+ ✅ The `"extends": "plugin:@graphql-eslint/operations-recommended"` property in a configuration file enables this rule.
4
4
 
5
- - Category: `Validation`
5
+ - Category: `Operations`
6
6
  - Rule name: `@graphql-eslint/overlapping-fields-can-be-merged`
7
7
  - Requires GraphQL Schema: `true` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
8
8
  - Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
@@ -1,8 +1,8 @@
1
1
  # `possible-fragment-spread`
2
2
 
3
- ✅ The `"extends": "plugin:@graphql-eslint/recommended"` property in a configuration file enables this rule.
3
+ ✅ The `"extends": "plugin:@graphql-eslint/operations-recommended"` property in a configuration file enables this rule.
4
4
 
5
- - Category: `Validation`
5
+ - Category: `Operations`
6
6
  - Rule name: `@graphql-eslint/possible-fragment-spread`
7
7
  - Requires GraphQL Schema: `true` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
8
8
  - Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
@@ -1,8 +1,8 @@
1
1
  # `possible-type-extension`
2
2
 
3
- ✅ The `"extends": "plugin:@graphql-eslint/recommended"` property in a configuration file enables this rule.
3
+ ✅ The `"extends": "plugin:@graphql-eslint/schema-recommended"` property in a configuration file enables this rule.
4
4
 
5
- - Category: `Validation`
5
+ - Category: `Schema`
6
6
  - Rule name: `@graphql-eslint/possible-type-extension`
7
7
  - Requires GraphQL Schema: `false` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
8
8
  - Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
@@ -1,8 +1,8 @@
1
1
  # `provided-required-arguments`
2
2
 
3
- ✅ The `"extends": "plugin:@graphql-eslint/recommended"` property in a configuration file enables this rule.
3
+ ✅ The `"extends": "plugin:@graphql-eslint/schema-recommended"` and `"plugin:@graphql-eslint/operations-recommended"` property in a configuration file enables this rule.
4
4
 
5
- - Category: `Validation`
5
+ - Category: `Schema & Operations`
6
6
  - Rule name: `@graphql-eslint/provided-required-arguments`
7
7
  - Requires GraphQL Schema: `true` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
8
8
  - Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
@@ -1,6 +1,6 @@
1
1
  # `require-deprecation-date`
2
2
 
3
- - Category: `Best Practices`
3
+ - Category: `Schema`
4
4
  - Rule name: `@graphql-eslint/require-deprecation-date`
5
5
  - Requires GraphQL Schema: `false` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
6
6
  - Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
@@ -1,8 +1,8 @@
1
1
  # `require-deprecation-reason`
2
2
 
3
- ✅ The `"extends": "plugin:@graphql-eslint/recommended"` property in a configuration file enables this rule.
3
+ ✅ The `"extends": "plugin:@graphql-eslint/schema-recommended"` property in a configuration file enables this rule.
4
4
 
5
- - Category: `Best Practices`
5
+ - Category: `Schema`
6
6
  - Rule name: `@graphql-eslint/require-deprecation-reason`
7
7
  - Requires GraphQL Schema: `false` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
8
8
  - Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
@@ -1,6 +1,6 @@
1
1
  # `require-description`
2
2
 
3
- - Category: `Best Practices`
3
+ - Category: `Schema`
4
4
  - Rule name: `@graphql-eslint/require-description`
5
5
  - Requires GraphQL Schema: `false` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
6
6
  - Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
@@ -12,7 +12,7 @@ Enforce descriptions in your type definitions.
12
12
  ### Incorrect
13
13
 
14
14
  ```graphql
15
- # eslint @graphql-eslint/require-description: ['error', { on: ['ObjectTypeDefinition', 'FieldDefinition'] }]
15
+ # eslint @graphql-eslint/require-description: ['error', { types: true, overrides: { FieldDefinition: true } }]
16
16
 
17
17
  type someTypeName {
18
18
  name: String
@@ -22,7 +22,7 @@ type someTypeName {
22
22
  ### Correct
23
23
 
24
24
  ```graphql
25
- # eslint @graphql-eslint/require-description: ['error', { on: ['ObjectTypeDefinition', 'FieldDefinition'] }]
25
+ # eslint @graphql-eslint/require-description: ['error', { types: true, overrides: { FieldDefinition: true } }]
26
26
 
27
27
  """
28
28
  Some type description
@@ -39,13 +39,42 @@ type someTypeName {
39
39
 
40
40
  The schema defines the following properties:
41
41
 
42
- ### `on` (array)
42
+ ### `types` (boolean)
43
43
 
44
- The object is an array with all elements of the type `string`.
44
+ Includes:
45
45
 
46
- Additional restrictions:
46
+ - [ObjectTypeDefinition](https://spec.graphql.org/October2021/#ObjectTypeDefinition)
47
+ - [InterfaceTypeDefinition](https://spec.graphql.org/October2021/#InterfaceTypeDefinition)
48
+ - [EnumTypeDefinition](https://spec.graphql.org/October2021/#EnumTypeDefinition)
49
+ - [ScalarTypeDefinition](https://spec.graphql.org/October2021/#ScalarTypeDefinition)
50
+ - [InputObjectTypeDefinition](https://spec.graphql.org/October2021/#InputObjectTypeDefinition)
51
+ - [UnionTypeDefinition](https://spec.graphql.org/October2021/#UnionTypeDefinition)
47
52
 
48
- * Minimum items: `1`
53
+ ### `overrides` (object)
54
+
55
+ Configuration for precise `ASTNode`
56
+
57
+ Properties of the `overrides` object:
58
+
59
+ #### `ObjectTypeDefinition` (boolean)
60
+
61
+ #### `InterfaceTypeDefinition` (boolean)
62
+
63
+ #### `EnumTypeDefinition` (boolean)
64
+
65
+ #### `ScalarTypeDefinition` (boolean)
66
+
67
+ #### `InputObjectTypeDefinition` (boolean)
68
+
69
+ #### `UnionTypeDefinition` (boolean)
70
+
71
+ #### `FieldDefinition` (boolean)
72
+
73
+ #### `InputValueDefinition` (boolean)
74
+
75
+ #### `EnumValueDefinition` (boolean)
76
+
77
+ #### `DirectiveDefinition` (boolean)
49
78
 
50
79
  ## Resources
51
80
 
@@ -1,6 +1,6 @@
1
1
  # `require-field-of-type-query-in-mutation-result`
2
2
 
3
- - Category: `Best Practices`
3
+ - Category: `Schema`
4
4
  - Rule name: `@graphql-eslint/require-field-of-type-query-in-mutation-result`
5
5
  - Requires GraphQL Schema: `true` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
6
6
  - Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
@@ -1,6 +1,8 @@
1
1
  # `require-id-when-available`
2
2
 
3
- - Category: `Best Practices`
3
+ The `"extends": "plugin:@graphql-eslint/operations-recommended"` property in a configuration file enables this rule.
4
+
5
+ - Category: `Operations`
4
6
  - Rule name: `@graphql-eslint/require-id-when-available`
5
7
  - Requires GraphQL Schema: `true` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
6
8
  - Requires GraphQL Operations: `true` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
@@ -1,8 +1,8 @@
1
1
  # `scalar-leafs`
2
2
 
3
- ✅ The `"extends": "plugin:@graphql-eslint/recommended"` property in a configuration file enables this rule.
3
+ ✅ The `"extends": "plugin:@graphql-eslint/operations-recommended"` property in a configuration file enables this rule.
4
4
 
5
- - Category: `Validation`
5
+ - Category: `Operations`
6
6
  - Rule name: `@graphql-eslint/scalar-leafs`
7
7
  - Requires GraphQL Schema: `true` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
8
8
  - Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)