@graphql-eslint/eslint-plugin 3.0.0-alpha-0a66b90.0 → 3.0.0-alpha-2918431.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/README.md +19 -8
- package/configs/base.d.ts +5 -0
- package/configs/index.d.ts +78 -121
- package/configs/operations-all.d.ts +19 -0
- package/configs/operations-recommended.d.ts +51 -0
- package/configs/schema-all.d.ts +21 -0
- package/configs/schema-recommended.d.ts +42 -0
- package/docs/README.md +10 -18
- package/docs/deprecated-rules.md +21 -0
- package/docs/rules/alphabetize.md +1 -1
- package/docs/rules/description-style.md +5 -3
- package/docs/rules/executable-definitions.md +2 -2
- package/docs/rules/fields-on-correct-type.md +2 -2
- package/docs/rules/fragments-on-composite-type.md +2 -2
- package/docs/rules/input-name.md +1 -1
- package/docs/rules/known-argument-names.md +2 -2
- package/docs/rules/known-directives.md +2 -2
- package/docs/rules/known-fragment-names.md +2 -2
- package/docs/rules/known-type-names.md +2 -2
- package/docs/rules/lone-anonymous-operation.md +2 -2
- package/docs/rules/lone-schema-definition.md +2 -2
- package/docs/rules/match-document-filename.md +6 -4
- package/docs/rules/naming-convention.md +140 -41
- package/docs/rules/no-anonymous-operations.md +2 -2
- package/docs/rules/no-case-insensitive-enum-values-duplicates.md +2 -2
- package/docs/rules/no-deprecated.md +3 -1
- package/docs/rules/{avoid-duplicate-fields.md → no-duplicate-fields.md} +10 -8
- package/docs/rules/no-fragment-cycles.md +2 -2
- package/docs/rules/no-hashtag-description.md +3 -1
- package/docs/rules/no-root-type.md +9 -14
- package/docs/rules/{avoid-scalar-result-type-on-mutation.md → no-scalar-result-type-on-mutation.md} +7 -7
- package/docs/rules/no-typename-prefix.md +37 -0
- package/docs/rules/no-undefined-variables.md +2 -2
- package/docs/rules/no-unreachable-types.md +3 -1
- package/docs/rules/no-unused-fields.md +1 -1
- package/docs/rules/no-unused-fragments.md +2 -2
- package/docs/rules/no-unused-variables.md +2 -2
- package/docs/rules/one-field-subscriptions.md +2 -2
- package/docs/rules/overlapping-fields-can-be-merged.md +2 -2
- package/docs/rules/possible-fragment-spread.md +2 -2
- package/docs/rules/possible-type-extension.md +2 -2
- package/docs/rules/provided-required-arguments.md +2 -2
- package/docs/rules/require-deprecation-date.md +1 -1
- package/docs/rules/require-deprecation-reason.md +2 -2
- package/docs/rules/require-description.md +36 -22
- package/docs/rules/require-field-of-type-query-in-mutation-result.md +1 -1
- package/docs/rules/require-id-when-available.md +3 -1
- package/docs/rules/scalar-leafs.md +2 -2
- package/docs/rules/selection-set-depth.md +9 -2
- package/docs/rules/strict-id-in-types.md +16 -10
- package/docs/rules/unique-argument-names.md +2 -2
- package/docs/rules/unique-directive-names-per-location.md +2 -2
- package/docs/rules/unique-directive-names.md +2 -2
- package/docs/rules/unique-enum-value-names.md +2 -2
- package/docs/rules/unique-field-definition-names.md +2 -2
- package/docs/rules/unique-fragment-name.md +1 -1
- package/docs/rules/unique-input-field-names.md +2 -2
- package/docs/rules/unique-operation-name.md +1 -1
- package/docs/rules/unique-operation-types.md +2 -2
- package/docs/rules/unique-type-names.md +2 -2
- package/docs/rules/unique-variable-names.md +2 -2
- package/docs/rules/value-literals-of-correct-type.md +2 -2
- package/docs/rules/variables-are-input-types.md +2 -2
- package/docs/rules/variables-in-allowed-position.md +2 -2
- package/index.js +651 -724
- package/index.mjs +652 -725
- package/package.json +1 -1
- package/rules/alphabetize.d.ts +8 -10
- package/rules/description-style.d.ts +4 -6
- package/rules/index.d.ts +115 -119
- package/rules/input-name.d.ts +1 -1
- package/rules/match-document-filename.d.ts +8 -10
- package/rules/naming-convention.d.ts +3 -4
- package/rules/{avoid-duplicate-fields.d.ts → no-duplicate-fields.d.ts} +0 -0
- package/rules/no-root-type.d.ts +1 -1
- package/rules/{avoid-scalar-result-type-on-mutation.d.ts → no-scalar-result-type-on-mutation.d.ts} +0 -0
- package/rules/{avoid-typename-prefix.d.ts → no-typename-prefix.d.ts} +0 -0
- package/rules/require-description.d.ts +2 -3
- package/rules/require-id-when-available.d.ts +3 -3
- package/rules/selection-set-depth.d.ts +3 -3
- package/rules/strict-id-in-types.d.ts +6 -8
- package/types.d.ts +9 -5
- package/configs/all.d.ts +0 -104
- package/configs/recommended.d.ts +0 -72
- package/docs/rules/avoid-operation-name-prefix.md +0 -50
- package/docs/rules/avoid-typename-prefix.md +0 -37
- package/docs/rules/no-operation-name-suffix.md +0 -38
- package/rules/avoid-operation-name-prefix.d.ts +0 -9
- package/rules/no-operation-name-suffix.d.ts +0 -3
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@graphql-eslint/eslint-plugin",
|
3
|
-
"version": "3.0.0-alpha-
|
3
|
+
"version": "3.0.0-alpha-2918431.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 || ^16.0.0"
|
package/rules/alphabetize.d.ts
CHANGED
@@ -4,14 +4,12 @@ declare const valuesEnum: ['EnumTypeDefinition'];
|
|
4
4
|
declare const selectionsEnum: ('OperationDefinition' | 'FragmentDefinition')[];
|
5
5
|
declare const variablesEnum: ['OperationDefinition'];
|
6
6
|
declare const argumentsEnum: ('FieldDefinition' | 'Field' | 'DirectiveDefinition' | 'Directive')[];
|
7
|
-
declare type AlphabetizeConfig =
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
];
|
16
|
-
declare const rule: GraphQLESLintRule<AlphabetizeConfig>;
|
7
|
+
declare type AlphabetizeConfig = {
|
8
|
+
fields?: typeof fieldsEnum;
|
9
|
+
values?: typeof valuesEnum;
|
10
|
+
selections?: typeof selectionsEnum;
|
11
|
+
variables?: typeof variablesEnum;
|
12
|
+
arguments?: typeof argumentsEnum;
|
13
|
+
};
|
14
|
+
declare const rule: GraphQLESLintRule<[AlphabetizeConfig]>;
|
17
15
|
export default rule;
|
@@ -1,8 +1,6 @@
|
|
1
1
|
import { GraphQLESLintRule } from '../types';
|
2
|
-
declare type DescriptionStyleRuleConfig =
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
];
|
7
|
-
declare const rule: GraphQLESLintRule<DescriptionStyleRuleConfig>;
|
2
|
+
declare type DescriptionStyleRuleConfig = {
|
3
|
+
style: 'inline' | 'block';
|
4
|
+
};
|
5
|
+
declare const rule: GraphQLESLintRule<[DescriptionStyleRuleConfig]>;
|
8
6
|
export default rule;
|
package/rules/index.d.ts
CHANGED
@@ -6,19 +6,15 @@ export declare const rules: {
|
|
6
6
|
variables?: ["OperationDefinition"];
|
7
7
|
arguments?: ("Field" | "Directive" | "FieldDefinition" | "DirectiveDefinition")[];
|
8
8
|
}], false>;
|
9
|
-
'avoid-duplicate-fields': import("..").GraphQLESLintRule<any[], false>;
|
10
|
-
'avoid-operation-name-prefix': import("..").GraphQLESLintRule<import("./avoid-operation-name-prefix").AvoidOperationNamePrefixConfig, false>;
|
11
|
-
'avoid-scalar-result-type-on-mutation': import("..").GraphQLESLintRule<any[], false>;
|
12
|
-
'avoid-typename-prefix': import("..").GraphQLESLintRule<any[], false>;
|
13
9
|
'description-style': import("..").GraphQLESLintRule<[{
|
14
10
|
style: "block" | "inline";
|
15
11
|
}], false>;
|
16
|
-
'input-name': import("..").GraphQLESLintRule<{
|
12
|
+
'input-name': import("..").GraphQLESLintRule<[{
|
17
13
|
checkInputType?: boolean;
|
18
14
|
caseSensitiveInputType?: boolean;
|
19
15
|
checkQueries?: boolean;
|
20
16
|
checkMutations?: boolean;
|
21
|
-
}
|
17
|
+
}], false>;
|
22
18
|
'match-document-filename': import("..").GraphQLESLintRule<[{
|
23
19
|
fileExtension?: ".gql" | ".graphql";
|
24
20
|
query?: import("../utils").CaseStyle | {
|
@@ -55,115 +51,116 @@ export declare const rules: {
|
|
55
51
|
forbiddenPrefixes?: string[];
|
56
52
|
forbiddenSuffixes?: string[];
|
57
53
|
};
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
};
|
54
|
+
} & {
|
55
|
+
[x: `OperationDefinition${string}`]: ("PascalCase" | "camelCase" | "UPPER_CASE" | "snake_case") | {
|
56
|
+
style?: "PascalCase" | "camelCase" | "UPPER_CASE" | "snake_case";
|
57
|
+
suffix?: string;
|
58
|
+
prefix?: string;
|
59
|
+
forbiddenPrefixes?: string[];
|
60
|
+
forbiddenSuffixes?: string[];
|
61
|
+
};
|
62
|
+
[x: `VariableDefinition${string}`]: ("PascalCase" | "camelCase" | "UPPER_CASE" | "snake_case") | {
|
63
|
+
style?: "PascalCase" | "camelCase" | "UPPER_CASE" | "snake_case";
|
64
|
+
suffix?: string;
|
65
|
+
prefix?: string;
|
66
|
+
forbiddenPrefixes?: string[];
|
67
|
+
forbiddenSuffixes?: string[];
|
68
|
+
};
|
69
|
+
[x: `Argument${string}`]: ("PascalCase" | "camelCase" | "UPPER_CASE" | "snake_case") | {
|
70
|
+
style?: "PascalCase" | "camelCase" | "UPPER_CASE" | "snake_case";
|
71
|
+
suffix?: string;
|
72
|
+
prefix?: string;
|
73
|
+
forbiddenPrefixes?: string[];
|
74
|
+
forbiddenSuffixes?: string[];
|
75
|
+
};
|
76
|
+
[x: `FragmentDefinition${string}`]: ("PascalCase" | "camelCase" | "UPPER_CASE" | "snake_case") | {
|
77
|
+
style?: "PascalCase" | "camelCase" | "UPPER_CASE" | "snake_case";
|
78
|
+
suffix?: string;
|
79
|
+
prefix?: string;
|
80
|
+
forbiddenPrefixes?: string[];
|
81
|
+
forbiddenSuffixes?: string[];
|
82
|
+
};
|
83
|
+
[x: `ScalarTypeDefinition${string}`]: ("PascalCase" | "camelCase" | "UPPER_CASE" | "snake_case") | {
|
84
|
+
style?: "PascalCase" | "camelCase" | "UPPER_CASE" | "snake_case";
|
85
|
+
suffix?: string;
|
86
|
+
prefix?: string;
|
87
|
+
forbiddenPrefixes?: string[];
|
88
|
+
forbiddenSuffixes?: string[];
|
89
|
+
};
|
90
|
+
[x: `ObjectTypeDefinition${string}`]: ("PascalCase" | "camelCase" | "UPPER_CASE" | "snake_case") | {
|
91
|
+
style?: "PascalCase" | "camelCase" | "UPPER_CASE" | "snake_case";
|
92
|
+
suffix?: string;
|
93
|
+
prefix?: string;
|
94
|
+
forbiddenPrefixes?: string[];
|
95
|
+
forbiddenSuffixes?: string[];
|
96
|
+
};
|
97
|
+
[x: `FieldDefinition${string}`]: ("PascalCase" | "camelCase" | "UPPER_CASE" | "snake_case") | {
|
98
|
+
style?: "PascalCase" | "camelCase" | "UPPER_CASE" | "snake_case";
|
99
|
+
suffix?: string;
|
100
|
+
prefix?: string;
|
101
|
+
forbiddenPrefixes?: string[];
|
102
|
+
forbiddenSuffixes?: string[];
|
103
|
+
};
|
104
|
+
[x: `InputValueDefinition${string}`]: ("PascalCase" | "camelCase" | "UPPER_CASE" | "snake_case") | {
|
105
|
+
style?: "PascalCase" | "camelCase" | "UPPER_CASE" | "snake_case";
|
106
|
+
suffix?: string;
|
107
|
+
prefix?: string;
|
108
|
+
forbiddenPrefixes?: string[];
|
109
|
+
forbiddenSuffixes?: string[];
|
110
|
+
};
|
111
|
+
[x: `InterfaceTypeDefinition${string}`]: ("PascalCase" | "camelCase" | "UPPER_CASE" | "snake_case") | {
|
112
|
+
style?: "PascalCase" | "camelCase" | "UPPER_CASE" | "snake_case";
|
113
|
+
suffix?: string;
|
114
|
+
prefix?: string;
|
115
|
+
forbiddenPrefixes?: string[];
|
116
|
+
forbiddenSuffixes?: string[];
|
117
|
+
};
|
118
|
+
[x: `UnionTypeDefinition${string}`]: ("PascalCase" | "camelCase" | "UPPER_CASE" | "snake_case") | {
|
119
|
+
style?: "PascalCase" | "camelCase" | "UPPER_CASE" | "snake_case";
|
120
|
+
suffix?: string;
|
121
|
+
prefix?: string;
|
122
|
+
forbiddenPrefixes?: string[];
|
123
|
+
forbiddenSuffixes?: string[];
|
124
|
+
};
|
125
|
+
[x: `EnumTypeDefinition${string}`]: ("PascalCase" | "camelCase" | "UPPER_CASE" | "snake_case") | {
|
126
|
+
style?: "PascalCase" | "camelCase" | "UPPER_CASE" | "snake_case";
|
127
|
+
suffix?: string;
|
128
|
+
prefix?: string;
|
129
|
+
forbiddenPrefixes?: string[];
|
130
|
+
forbiddenSuffixes?: string[];
|
131
|
+
};
|
132
|
+
[x: `EnumValueDefinition${string}`]: ("PascalCase" | "camelCase" | "UPPER_CASE" | "snake_case") | {
|
133
|
+
style?: "PascalCase" | "camelCase" | "UPPER_CASE" | "snake_case";
|
134
|
+
suffix?: string;
|
135
|
+
prefix?: string;
|
136
|
+
forbiddenPrefixes?: string[];
|
137
|
+
forbiddenSuffixes?: string[];
|
138
|
+
};
|
139
|
+
[x: `InputObjectTypeDefinition${string}`]: ("PascalCase" | "camelCase" | "UPPER_CASE" | "snake_case") | {
|
140
|
+
style?: "PascalCase" | "camelCase" | "UPPER_CASE" | "snake_case";
|
141
|
+
suffix?: string;
|
142
|
+
prefix?: string;
|
143
|
+
forbiddenPrefixes?: string[];
|
144
|
+
forbiddenSuffixes?: string[];
|
145
|
+
};
|
146
|
+
[x: `DirectiveDefinition${string}`]: ("PascalCase" | "camelCase" | "UPPER_CASE" | "snake_case") | {
|
147
|
+
style?: "PascalCase" | "camelCase" | "UPPER_CASE" | "snake_case";
|
148
|
+
suffix?: string;
|
149
|
+
prefix?: string;
|
150
|
+
forbiddenPrefixes?: string[];
|
151
|
+
forbiddenSuffixes?: string[];
|
157
152
|
};
|
158
153
|
}], false>;
|
159
154
|
'no-anonymous-operations': import("..").GraphQLESLintRule<any[], false>;
|
160
155
|
'no-case-insensitive-enum-values-duplicates': import("..").GraphQLESLintRule<any[], false>;
|
161
156
|
'no-deprecated': import("..").GraphQLESLintRule<[], true>;
|
157
|
+
'no-duplicate-fields': import("..").GraphQLESLintRule<any[], false>;
|
162
158
|
'no-hashtag-description': import("..").GraphQLESLintRule<any[], false>;
|
163
|
-
'no-operation-name-suffix': import("..").GraphQLESLintRule<any[], false>;
|
164
159
|
'no-root-type': import("..").GraphQLESLintRule<[{
|
165
|
-
disallow: ("
|
160
|
+
disallow: ("mutation" | "subscription")[];
|
166
161
|
}], false>;
|
162
|
+
'no-scalar-result-type-on-mutation': import("..").GraphQLESLintRule<any[], false>;
|
163
|
+
'no-typename-prefix': import("..").GraphQLESLintRule<any[], false>;
|
167
164
|
'no-unreachable-types': import("..").GraphQLESLintRule<any[], false>;
|
168
165
|
'no-unused-fields': import("..").GraphQLESLintRule<any[], false>;
|
169
166
|
'require-deprecation-date': import("..").GraphQLESLintRule<[{
|
@@ -172,18 +169,17 @@ export declare const rules: {
|
|
172
169
|
'require-deprecation-reason': import("..").GraphQLESLintRule<any[], false>;
|
173
170
|
'require-description': import("..").GraphQLESLintRule<[{
|
174
171
|
types?: boolean;
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
};
|
172
|
+
} & {
|
173
|
+
ScalarTypeDefinition?: boolean;
|
174
|
+
ObjectTypeDefinition?: boolean;
|
175
|
+
FieldDefinition?: boolean;
|
176
|
+
InputValueDefinition?: boolean;
|
177
|
+
InterfaceTypeDefinition?: boolean;
|
178
|
+
UnionTypeDefinition?: boolean;
|
179
|
+
EnumTypeDefinition?: boolean;
|
180
|
+
EnumValueDefinition?: boolean;
|
181
|
+
InputObjectTypeDefinition?: boolean;
|
182
|
+
DirectiveDefinition?: boolean;
|
187
183
|
}], false>;
|
188
184
|
'require-field-of-type-query-in-mutation-result': import("..").GraphQLESLintRule<any[], false>;
|
189
185
|
'require-id-when-available': import("..").GraphQLESLintRule<[{
|
package/rules/input-name.d.ts
CHANGED
@@ -5,14 +5,12 @@ declare type PropertySchema = {
|
|
5
5
|
style: CaseStyle;
|
6
6
|
suffix: string;
|
7
7
|
};
|
8
|
-
declare type MatchDocumentFilenameRuleConfig =
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
];
|
17
|
-
declare const rule: GraphQLESLintRule<MatchDocumentFilenameRuleConfig>;
|
8
|
+
declare type MatchDocumentFilenameRuleConfig = {
|
9
|
+
fileExtension?: typeof ACCEPTED_EXTENSIONS[number];
|
10
|
+
query?: CaseStyle | PropertySchema;
|
11
|
+
mutation?: CaseStyle | PropertySchema;
|
12
|
+
subscription?: CaseStyle | PropertySchema;
|
13
|
+
fragment?: CaseStyle | PropertySchema;
|
14
|
+
};
|
15
|
+
declare const rule: GraphQLESLintRule<[MatchDocumentFilenameRuleConfig]>;
|
18
16
|
export default rule;
|
@@ -8,12 +8,12 @@ declare const KindToDisplayName: {
|
|
8
8
|
UnionTypeDefinition: string;
|
9
9
|
FieldDefinition: string;
|
10
10
|
InputValueDefinition: string;
|
11
|
-
VariableDefinition: string;
|
12
11
|
Argument: string;
|
13
12
|
DirectiveDefinition: string;
|
14
13
|
EnumValueDefinition: string;
|
15
14
|
OperationDefinition: string;
|
16
15
|
FragmentDefinition: string;
|
16
|
+
VariableDefinition: string;
|
17
17
|
};
|
18
18
|
declare type AllowedKind = keyof typeof KindToDisplayName;
|
19
19
|
declare type AllowedStyle = 'camelCase' | 'PascalCase' | 'snake_case' | 'UPPER_CASE';
|
@@ -30,9 +30,8 @@ declare type NamingConventionRuleConfig = {
|
|
30
30
|
allowTrailingUnderscore?: boolean;
|
31
31
|
types?: Options;
|
32
32
|
fields?: Options;
|
33
|
-
|
34
|
-
|
35
|
-
};
|
33
|
+
} & {
|
34
|
+
[key in `${AllowedKind}${string}`]?: Options;
|
36
35
|
};
|
37
36
|
declare const rule: GraphQLESLintRule<[NamingConventionRuleConfig]>;
|
38
37
|
export default rule;
|
File without changes
|
package/rules/no-root-type.d.ts
CHANGED
package/rules/{avoid-scalar-result-type-on-mutation.d.ts → no-scalar-result-type-on-mutation.d.ts}
RENAMED
File without changes
|
File without changes
|
@@ -4,9 +4,8 @@ declare const ALLOWED_KINDS: readonly [Kind.OBJECT_TYPE_DEFINITION, Kind.INTERFA
|
|
4
4
|
declare type AllowedKind = typeof ALLOWED_KINDS[number];
|
5
5
|
declare type RequireDescriptionRuleConfig = {
|
6
6
|
types?: boolean;
|
7
|
-
|
8
|
-
|
9
|
-
};
|
7
|
+
} & {
|
8
|
+
[key in AllowedKind]?: boolean;
|
10
9
|
};
|
11
10
|
declare const rule: GraphQLESLintRule<[RequireDescriptionRuleConfig]>;
|
12
11
|
export default rule;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { GraphQLESLintRule } from '../types';
|
2
|
-
declare type RequireIdWhenAvailableRuleConfig =
|
2
|
+
declare type RequireIdWhenAvailableRuleConfig = {
|
3
3
|
fieldName: string;
|
4
|
-
}
|
5
|
-
declare const rule: GraphQLESLintRule<RequireIdWhenAvailableRuleConfig, true>;
|
4
|
+
};
|
5
|
+
declare const rule: GraphQLESLintRule<[RequireIdWhenAvailableRuleConfig], true>;
|
6
6
|
export default rule;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { GraphQLESLintRule } from '../types';
|
2
|
-
declare type SelectionSetDepthRuleConfig =
|
2
|
+
declare type SelectionSetDepthRuleConfig = {
|
3
3
|
maxDepth: number;
|
4
4
|
ignore?: string[];
|
5
|
-
}
|
6
|
-
declare const rule: GraphQLESLintRule<SelectionSetDepthRuleConfig>;
|
5
|
+
};
|
6
|
+
declare const rule: GraphQLESLintRule<[SelectionSetDepthRuleConfig]>;
|
7
7
|
export default rule;
|
@@ -3,12 +3,10 @@ export interface ExceptionRule {
|
|
3
3
|
types?: string[];
|
4
4
|
suffixes?: string[];
|
5
5
|
}
|
6
|
-
declare type StrictIdInTypesRuleConfig =
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
];
|
13
|
-
declare const rule: GraphQLESLintRule<StrictIdInTypesRuleConfig>;
|
6
|
+
declare type StrictIdInTypesRuleConfig = {
|
7
|
+
acceptedIdNames?: string[];
|
8
|
+
acceptedIdTypes?: string[];
|
9
|
+
exceptions?: ExceptionRule;
|
10
|
+
};
|
11
|
+
declare const rule: GraphQLESLintRule<[StrictIdInTypesRuleConfig]>;
|
14
12
|
export default rule;
|
package/types.d.ts
CHANGED
@@ -45,9 +45,10 @@ export declare type GraphQLESLintRuleContext<Options = any[]> = Omit<Rule.RuleCo
|
|
45
45
|
})): void;
|
46
46
|
parserServices?: ParserServices;
|
47
47
|
};
|
48
|
-
export declare type
|
49
|
-
|
50
|
-
|
48
|
+
export declare type CategoryType = 'Schema' | 'Operations';
|
49
|
+
export declare type RuleDocsInfo<T> = {
|
50
|
+
docs: Omit<Rule.RuleMetaData['docs'], 'category'> & {
|
51
|
+
category: CategoryType | CategoryType[];
|
51
52
|
requiresSchema?: boolean;
|
52
53
|
requiresSiblings?: boolean;
|
53
54
|
examples?: {
|
@@ -55,12 +56,15 @@ export declare type RuleDocsInfo<T> = Rule.RuleMetaData & {
|
|
55
56
|
code: string;
|
56
57
|
usage?: T;
|
57
58
|
}[];
|
58
|
-
|
59
|
+
configOptions?: T | {
|
60
|
+
schema?: T;
|
61
|
+
operations?: T;
|
62
|
+
};
|
59
63
|
graphQLJSRuleName?: string;
|
60
64
|
};
|
61
65
|
};
|
62
66
|
export declare type GraphQLESLintRule<Options = any[], WithTypeInfo extends boolean = false> = {
|
63
67
|
create(context: GraphQLESLintRuleContext<Options>): GraphQLESLintRuleListener<WithTypeInfo>;
|
64
|
-
meta: Rule.RuleMetaData & RuleDocsInfo<Options>;
|
68
|
+
meta: Omit<Rule.RuleMetaData, 'docs'> & RuleDocsInfo<Options>;
|
65
69
|
};
|
66
70
|
export declare type ValueOf<T> = T[keyof T];
|
package/configs/all.d.ts
DELETED
@@ -1,104 +0,0 @@
|
|
1
|
-
export declare const allConfig: {
|
2
|
-
rules: {
|
3
|
-
'@graphql-eslint/alphabetize': (string | {
|
4
|
-
fields: string[];
|
5
|
-
values: string[];
|
6
|
-
selections: string[];
|
7
|
-
variables: string[];
|
8
|
-
arguments: string[];
|
9
|
-
})[];
|
10
|
-
'@graphql-eslint/avoid-duplicate-fields': string;
|
11
|
-
'@graphql-eslint/avoid-operation-name-prefix': string;
|
12
|
-
'@graphql-eslint/avoid-scalar-result-type-on-mutation': string;
|
13
|
-
'@graphql-eslint/description-style': string;
|
14
|
-
'@graphql-eslint/input-name': string;
|
15
|
-
'@graphql-eslint/match-document-filename': string;
|
16
|
-
'@graphql-eslint/no-deprecated': string;
|
17
|
-
'@graphql-eslint/no-hashtag-description': string;
|
18
|
-
'@graphql-eslint/no-root-type': (string | {
|
19
|
-
disallow: string[];
|
20
|
-
})[];
|
21
|
-
'@graphql-eslint/no-unreachable-types': string;
|
22
|
-
'@graphql-eslint/no-unused-fields': string;
|
23
|
-
'@graphql-eslint/require-deprecation-date': string;
|
24
|
-
'@graphql-eslint/require-description': (string | {
|
25
|
-
types: boolean;
|
26
|
-
overrides: {
|
27
|
-
DirectiveDefinition: boolean;
|
28
|
-
};
|
29
|
-
})[];
|
30
|
-
'@graphql-eslint/require-field-of-type-query-in-mutation-result': string;
|
31
|
-
'@graphql-eslint/require-id-when-available': string;
|
32
|
-
'@graphql-eslint/selection-set-depth': string;
|
33
|
-
'@graphql-eslint/unique-fragment-name': string;
|
34
|
-
'@graphql-eslint/unique-operation-name': string;
|
35
|
-
'@graphql-eslint/avoid-typename-prefix': string;
|
36
|
-
'@graphql-eslint/executable-definitions': string;
|
37
|
-
'@graphql-eslint/fields-on-correct-type': string;
|
38
|
-
'@graphql-eslint/fragments-on-composite-type': string;
|
39
|
-
'@graphql-eslint/known-argument-names': string;
|
40
|
-
'@graphql-eslint/known-directives': string;
|
41
|
-
'@graphql-eslint/known-fragment-names': string;
|
42
|
-
'@graphql-eslint/known-type-names': string;
|
43
|
-
'@graphql-eslint/lone-anonymous-operation': string;
|
44
|
-
'@graphql-eslint/lone-schema-definition': string;
|
45
|
-
'@graphql-eslint/naming-convention': (string | {
|
46
|
-
types: string;
|
47
|
-
fields: string;
|
48
|
-
overrides: {
|
49
|
-
EnumValueDefinition: string;
|
50
|
-
OperationDefinition: {
|
51
|
-
style: string;
|
52
|
-
forbiddenPrefixes: string[];
|
53
|
-
forbiddenSuffixes: string[];
|
54
|
-
};
|
55
|
-
FragmentDefinition: {
|
56
|
-
style: string;
|
57
|
-
forbiddenPrefixes: string[];
|
58
|
-
forbiddenSuffixes: string[];
|
59
|
-
};
|
60
|
-
'FieldDefinition[parent.name.value=Query]': {
|
61
|
-
forbiddenPrefixes: string[];
|
62
|
-
forbiddenSuffixes: string[];
|
63
|
-
};
|
64
|
-
'FieldDefinition[parent.name.value=Mutation]': {
|
65
|
-
forbiddenPrefixes: string[];
|
66
|
-
forbiddenSuffixes: string[];
|
67
|
-
};
|
68
|
-
'FieldDefinition[parent.name.value=Subscription]': {
|
69
|
-
forbiddenPrefixes: string[];
|
70
|
-
forbiddenSuffixes: string[];
|
71
|
-
};
|
72
|
-
};
|
73
|
-
})[];
|
74
|
-
'@graphql-eslint/no-anonymous-operations': string;
|
75
|
-
'@graphql-eslint/no-case-insensitive-enum-values-duplicates': string;
|
76
|
-
'@graphql-eslint/no-fragment-cycles': string;
|
77
|
-
'@graphql-eslint/no-operation-name-suffix': string;
|
78
|
-
'@graphql-eslint/no-undefined-variables': string;
|
79
|
-
'@graphql-eslint/no-unused-fragments': string;
|
80
|
-
'@graphql-eslint/no-unused-variables': string;
|
81
|
-
'@graphql-eslint/one-field-subscriptions': string;
|
82
|
-
'@graphql-eslint/overlapping-fields-can-be-merged': string;
|
83
|
-
'@graphql-eslint/possible-fragment-spread': string;
|
84
|
-
'@graphql-eslint/possible-type-extension': string;
|
85
|
-
'@graphql-eslint/provided-required-arguments': string;
|
86
|
-
'@graphql-eslint/require-deprecation-reason': string;
|
87
|
-
'@graphql-eslint/scalar-leafs': string;
|
88
|
-
'@graphql-eslint/strict-id-in-types': string;
|
89
|
-
'@graphql-eslint/unique-argument-names': string;
|
90
|
-
'@graphql-eslint/unique-directive-names': string;
|
91
|
-
'@graphql-eslint/unique-directive-names-per-location': string;
|
92
|
-
'@graphql-eslint/unique-enum-value-names': string;
|
93
|
-
'@graphql-eslint/unique-field-definition-names': string;
|
94
|
-
'@graphql-eslint/unique-input-field-names': string;
|
95
|
-
'@graphql-eslint/unique-operation-types': string;
|
96
|
-
'@graphql-eslint/unique-type-names': string;
|
97
|
-
'@graphql-eslint/unique-variable-names': string;
|
98
|
-
'@graphql-eslint/value-literals-of-correct-type': string;
|
99
|
-
'@graphql-eslint/variables-are-input-types': string;
|
100
|
-
'@graphql-eslint/variables-in-allowed-position': string;
|
101
|
-
};
|
102
|
-
parser: string;
|
103
|
-
plugins: string[];
|
104
|
-
};
|