@graphql-eslint/eslint-plugin 2.3.0-alpha-4c161e5.0 → 2.3.0-alpha-6ba4002.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.
package/configs/all.d.ts CHANGED
@@ -1,12 +1,5 @@
1
1
  export declare const allConfig: {
2
2
  rules: {
3
- '@graphql-eslint/alphabetize': (string | {
4
- fields: string[];
5
- values: string[];
6
- selections: string[];
7
- variables: string[];
8
- arguments: string[];
9
- })[];
10
3
  '@graphql-eslint/avoid-duplicate-fields': string;
11
4
  '@graphql-eslint/avoid-operation-name-prefix': string;
12
5
  '@graphql-eslint/avoid-scalar-result-type-on-mutation': string;
@@ -1,13 +1,6 @@
1
1
  export declare const configs: {
2
2
  all: {
3
3
  rules: {
4
- '@graphql-eslint/alphabetize': (string | {
5
- fields: string[];
6
- values: string[];
7
- selections: string[];
8
- variables: string[];
9
- arguments: string[];
10
- })[];
11
4
  '@graphql-eslint/avoid-duplicate-fields': string;
12
5
  '@graphql-eslint/avoid-operation-name-prefix': string;
13
6
  '@graphql-eslint/avoid-scalar-result-type-on-mutation': string;
package/docs/README.md CHANGED
@@ -11,7 +11,6 @@ Each rule has emojis denoting:
11
11
  <!-- prettier-ignore-start -->
12
12
  Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|Description|🚀&nbsp;/&nbsp;🔮|🔧|✅
13
13
  -|-|:-:|-|-
14
- [alphabetize](rules/alphabetize.md)|Enforce arrange in alphabetical order for type fields, enum values, input object fields, operation selections and more.|🚀||
15
14
  [avoid-duplicate-fields](rules/avoid-duplicate-fields.md)|Checks for duplicate fields in selection set, variables in operation definition, or in arguments set of a field.|🚀||
16
15
  [avoid-operation-name-prefix](rules/avoid-operation-name-prefix.md)|Enforce/avoid operation name prefix, useful if you wish to avoid prefix in your root fields, or avoid using REST terminology in your schema.|🚀||
17
16
  [avoid-scalar-result-type-on-mutation](rules/avoid-scalar-result-type-on-mutation.md)|Avoid scalar result type on mutation type to make sure to return a valid state.|🚀||
@@ -31,13 +31,17 @@ query userDetails {
31
31
 
32
32
  ## Config Schema
33
33
 
34
- The schema defines the following properties:
34
+ ### (array)
35
35
 
36
- ### `caseSensitive` (boolean)
36
+ The schema defines an array with all elements of the type `object`.
37
+
38
+ The array object has the following properties:
39
+
40
+ #### `caseSensitive` (boolean)
37
41
 
38
42
  Default: `false`
39
43
 
40
- ### `keywords` (array, required)
44
+ #### `keywords` (array, required)
41
45
 
42
46
  The object is an array with all elements of the type `string`.
43
47
 
@@ -16,7 +16,7 @@ Require all comments to follow the same style (either block or inline).
16
16
 
17
17
  """ Description """
18
18
  type someTypeName {
19
- # ...
19
+ ...
20
20
  }
21
21
  ```
22
22
 
@@ -27,15 +27,19 @@ type someTypeName {
27
27
 
28
28
  " Description "
29
29
  type someTypeName {
30
- # ...
30
+ ...
31
31
  }
32
32
  ```
33
33
 
34
34
  ## Config Schema
35
35
 
36
- The schema defines the following properties:
36
+ ### (array)
37
37
 
38
- ### `style` (string, enum)
38
+ The schema defines an array with all elements of the type `object`.
39
+
40
+ The array object has the following properties:
41
+
42
+ #### `style` (string, enum)
39
43
 
40
44
  This element must be one of the following enum values:
41
45
 
@@ -42,27 +42,31 @@ type Mutation {
42
42
 
43
43
  ## Config Schema
44
44
 
45
- The schema defines the following properties:
45
+ ### (array)
46
46
 
47
- ### `checkInputType` (boolean)
47
+ The schema defines an array with all elements of the type `object`.
48
+
49
+ The array object has the following properties:
50
+
51
+ #### `checkInputType` (boolean)
48
52
 
49
53
  Check that the input type name follows the convention <mutationName>Input
50
54
 
51
55
  Default: `false`
52
56
 
53
- ### `caseSensitiveInputType` (boolean)
57
+ #### `caseSensitiveInputType` (boolean)
54
58
 
55
59
  Allow for case discrepancies in the input type name
56
60
 
57
61
  Default: `true`
58
62
 
59
- ### `checkQueries` (boolean)
63
+ #### `checkQueries` (boolean)
60
64
 
61
65
  Apply the rule to Queries
62
66
 
63
67
  Default: `false`
64
68
 
65
- ### `checkMutations` (boolean)
69
+ #### `checkMutations` (boolean)
66
70
 
67
71
  Apply the rule to Mutations
68
72
 
@@ -86,37 +86,41 @@ query UserById {
86
86
 
87
87
  ## Config Schema
88
88
 
89
- The schema defines the following properties:
89
+ ### (array)
90
90
 
91
- ### `fileExtension` (string, enum)
91
+ The schema defines an array with all elements of the type `object`.
92
+
93
+ The array object has the following properties:
94
+
95
+ #### `fileExtension` (string, enum)
92
96
 
93
97
  This element must be one of the following enum values:
94
98
 
95
99
  * `.gql`
96
100
  * `.graphql`
97
101
 
98
- ### `query`
102
+ #### `query`
99
103
 
100
104
  The object must be one of the following types:
101
105
 
102
106
  * `asString`
103
107
  * `asObject`
104
108
 
105
- ### `mutation`
109
+ #### `mutation`
106
110
 
107
111
  The object must be one of the following types:
108
112
 
109
113
  * `asString`
110
114
  * `asObject`
111
115
 
112
- ### `subscription`
116
+ #### `subscription`
113
117
 
114
118
  The object must be one of the following types:
115
119
 
116
120
  * `asString`
117
121
  * `asObject`
118
122
 
119
- ### `fragment`
123
+ #### `fragment`
120
124
 
121
125
  The object must be one of the following types:
122
126
 
@@ -33,93 +33,97 @@ type SomeTypeName {
33
33
 
34
34
  ## Config Schema
35
35
 
36
- The schema defines the following properties:
36
+ ### (array)
37
37
 
38
- ### `FieldDefinition`
38
+ The schema defines an array with all elements of the type `object`.
39
+
40
+ The array object has the following properties:
41
+
42
+ #### `FieldDefinition`
39
43
 
40
44
  The object must be one of the following types:
41
45
 
42
46
  * `asString`
43
47
  * `asObject`
44
48
 
45
- ### `InputObjectTypeDefinition`
49
+ #### `InputObjectTypeDefinition`
46
50
 
47
51
  The object must be one of the following types:
48
52
 
49
53
  * `asString`
50
54
  * `asObject`
51
55
 
52
- ### `EnumValueDefinition`
56
+ #### `EnumValueDefinition`
53
57
 
54
58
  The object must be one of the following types:
55
59
 
56
60
  * `asString`
57
61
  * `asObject`
58
62
 
59
- ### `InputValueDefinition`
63
+ #### `InputValueDefinition`
60
64
 
61
65
  The object must be one of the following types:
62
66
 
63
67
  * `asString`
64
68
  * `asObject`
65
69
 
66
- ### `ObjectTypeDefinition`
70
+ #### `ObjectTypeDefinition`
67
71
 
68
72
  The object must be one of the following types:
69
73
 
70
74
  * `asString`
71
75
  * `asObject`
72
76
 
73
- ### `InterfaceTypeDefinition`
77
+ #### `InterfaceTypeDefinition`
74
78
 
75
79
  The object must be one of the following types:
76
80
 
77
81
  * `asString`
78
82
  * `asObject`
79
83
 
80
- ### `EnumTypeDefinition`
84
+ #### `EnumTypeDefinition`
81
85
 
82
86
  The object must be one of the following types:
83
87
 
84
88
  * `asString`
85
89
  * `asObject`
86
90
 
87
- ### `UnionTypeDefinition`
91
+ #### `UnionTypeDefinition`
88
92
 
89
93
  The object must be one of the following types:
90
94
 
91
95
  * `asString`
92
96
  * `asObject`
93
97
 
94
- ### `ScalarTypeDefinition`
98
+ #### `ScalarTypeDefinition`
95
99
 
96
100
  The object must be one of the following types:
97
101
 
98
102
  * `asString`
99
103
  * `asObject`
100
104
 
101
- ### `OperationDefinition`
105
+ #### `OperationDefinition`
102
106
 
103
107
  The object must be one of the following types:
104
108
 
105
109
  * `asString`
106
110
  * `asObject`
107
111
 
108
- ### `FragmentDefinition`
112
+ #### `FragmentDefinition`
109
113
 
110
114
  The object must be one of the following types:
111
115
 
112
116
  * `asString`
113
117
  * `asObject`
114
118
 
115
- ### `QueryDefinition`
119
+ #### `QueryDefinition`
116
120
 
117
121
  The object must be one of the following types:
118
122
 
119
123
  * `asString`
120
124
  * `asObject`
121
125
 
122
- ### `leadingUnderscore` (string, enum)
126
+ #### `leadingUnderscore` (string, enum)
123
127
 
124
128
  This element must be one of the following enum values:
125
129
 
@@ -128,7 +132,7 @@ This element must be one of the following enum values:
128
132
 
129
133
  Default: `"forbid"`
130
134
 
131
- ### `trailingUnderscore` (string, enum)
135
+ #### `trailingUnderscore` (string, enum)
132
136
 
133
137
  This element must be one of the following enum values:
134
138
 
@@ -44,6 +44,10 @@ type User {
44
44
 
45
45
  ## Config Schema
46
46
 
47
- The schema defines the following properties:
47
+ ### (array)
48
48
 
49
- ### `argumentName` (string)
49
+ The schema defines an array with all elements of the type `object`.
50
+
51
+ The array object has the following properties:
52
+
53
+ #### `argumentName` (string)
@@ -37,12 +37,20 @@ type someTypeName {
37
37
 
38
38
  ## Config Schema
39
39
 
40
- The schema defines the following properties:
40
+ ### (array)
41
41
 
42
- ### `on` (array)
42
+ The schema defines an array with all elements of the type `object`.
43
+
44
+ The array object has the following properties:
45
+
46
+ #### `on` (array)
43
47
 
44
48
  The object is an array with all elements of the type `string`.
45
49
 
46
50
  Additional restrictions:
47
51
 
52
+ * Minimum items: `1`
53
+
54
+ Additional restrictions:
55
+
48
56
  * Minimum items: `1`
@@ -50,8 +50,12 @@ query user {
50
50
 
51
51
  ## Config Schema
52
52
 
53
- The schema defines the following properties:
53
+ ### (array)
54
54
 
55
- ### `fieldName` (string)
55
+ The schema defines an array with all elements of the type `object`.
56
+
57
+ The array object has the following properties:
58
+
59
+ #### `fieldName` (string)
56
60
 
57
61
  Default: `"id"`
@@ -53,10 +53,18 @@ query deep2 {
53
53
 
54
54
  ## Config Schema
55
55
 
56
- The schema defines the following properties:
56
+ ### (array)
57
57
 
58
- ### `maxDepth` (number)
58
+ The schema defines an array with all elements of the type `object`.
59
59
 
60
- ### `ignore` (array)
60
+ The array object has the following properties:
61
61
 
62
- The object is an array with all elements of the type `string`.
62
+ #### `maxDepth` (number)
63
+
64
+ #### `ignore` (array)
65
+
66
+ The object is an array with all elements of the type `string`.
67
+
68
+ Additional restrictions:
69
+
70
+ * Minimum items: `1`
@@ -62,9 +62,13 @@ type Error {
62
62
 
63
63
  ## Config Schema
64
64
 
65
- The schema defines the following properties:
65
+ ### (array)
66
66
 
67
- ### `acceptedIdNames` (array)
67
+ The schema defines an array with all elements of the type `object`.
68
+
69
+ The array object has the following properties:
70
+
71
+ #### `acceptedIdNames` (array)
68
72
 
69
73
  The object is an array with all elements of the type `string`.
70
74
 
@@ -76,7 +80,7 @@ Default:
76
80
  ]
77
81
  ```
78
82
 
79
- ### `acceptedIdTypes` (array)
83
+ #### `acceptedIdTypes` (array)
80
84
 
81
85
  The object is an array with all elements of the type `string`.
82
86
 
@@ -88,11 +92,11 @@ Default:
88
92
  ]
89
93
  ```
90
94
 
91
- ### `exceptions` (object)
95
+ #### `exceptions` (object)
92
96
 
93
97
  Properties of the `exceptions` object:
94
98
 
95
- #### `types` (array)
99
+ ##### `types` (array)
96
100
 
97
101
  This is used to exclude types with names that match one of the specified values.
98
102
 
@@ -104,7 +108,7 @@ Default:
104
108
  []
105
109
  ```
106
110
 
107
- #### `suffixes` (array)
111
+ ##### `suffixes` (array)
108
112
 
109
113
  This is used to exclude types with names with suffixes that match one of the specified values.
110
114