@graphql-eslint/eslint-plugin 3.2.0-alpha-4ca7218.0 → 3.3.0-alpha-b07557f.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/docs/rules/require-id-when-available.md +16 -1
- package/graphql-config.d.ts +2 -1
- package/index.js +246 -176
- package/index.mjs +246 -176
- package/package.json +3 -2
- package/rules/index.d.ts +2 -129
- package/rules/match-document-filename.d.ts +3 -3
- package/rules/naming-convention.d.ts +1 -1
- package/types.d.ts +1 -0
- package/utils.d.ts +2 -7
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@graphql-eslint/eslint-plugin",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.3.0-alpha-b07557f.0",
|
4
4
|
"description": "GraphQL plugin for ESLint",
|
5
5
|
"sideEffects": false,
|
6
6
|
"peerDependencies": {
|
@@ -10,7 +10,7 @@
|
|
10
10
|
"@babel/code-frame": "7.16.0",
|
11
11
|
"@graphql-tools/code-file-loader": "7.2.3",
|
12
12
|
"@graphql-tools/graphql-tag-pluck": "7.1.4",
|
13
|
-
"@graphql-tools/utils": "8.5.
|
13
|
+
"@graphql-tools/utils": "8.5.5",
|
14
14
|
"graphql-config": "4.1.0",
|
15
15
|
"graphql-depth-limit": "1.1.0",
|
16
16
|
"lodash.lowercase": "4.3.0"
|
@@ -31,6 +31,7 @@
|
|
31
31
|
"definition": "index.d.ts"
|
32
32
|
},
|
33
33
|
"exports": {
|
34
|
+
"./package.json": "./package.json",
|
34
35
|
".": {
|
35
36
|
"require": "./index.js",
|
36
37
|
"import": "./index.mjs"
|
package/rules/index.d.ts
CHANGED
@@ -15,135 +15,8 @@ export declare const rules: {
|
|
15
15
|
checkQueries?: boolean;
|
16
16
|
checkMutations?: boolean;
|
17
17
|
}], false>;
|
18
|
-
'match-document-filename': import("..").GraphQLESLintRule<[
|
19
|
-
|
20
|
-
query?: import("../utils").CaseStyle | {
|
21
|
-
style: import("../utils").CaseStyle;
|
22
|
-
suffix: string;
|
23
|
-
};
|
24
|
-
mutation?: import("../utils").CaseStyle | {
|
25
|
-
style: import("../utils").CaseStyle;
|
26
|
-
suffix: string;
|
27
|
-
};
|
28
|
-
subscription?: import("../utils").CaseStyle | {
|
29
|
-
style: import("../utils").CaseStyle;
|
30
|
-
suffix: string;
|
31
|
-
};
|
32
|
-
fragment?: import("../utils").CaseStyle | {
|
33
|
-
style: import("../utils").CaseStyle;
|
34
|
-
suffix: string;
|
35
|
-
};
|
36
|
-
}], false>;
|
37
|
-
'naming-convention': import("..").GraphQLESLintRule<[{
|
38
|
-
allowLeadingUnderscore?: boolean;
|
39
|
-
allowTrailingUnderscore?: boolean;
|
40
|
-
types?: ("PascalCase" | "camelCase" | "UPPER_CASE" | "snake_case") | {
|
41
|
-
style?: "PascalCase" | "camelCase" | "UPPER_CASE" | "snake_case";
|
42
|
-
suffix?: string;
|
43
|
-
prefix?: string;
|
44
|
-
forbiddenPrefixes?: string[];
|
45
|
-
forbiddenSuffixes?: string[];
|
46
|
-
};
|
47
|
-
} & {
|
48
|
-
[x: `OperationDefinition${string}`]: ("PascalCase" | "camelCase" | "UPPER_CASE" | "snake_case") | {
|
49
|
-
style?: "PascalCase" | "camelCase" | "UPPER_CASE" | "snake_case";
|
50
|
-
suffix?: string;
|
51
|
-
prefix?: string;
|
52
|
-
forbiddenPrefixes?: string[];
|
53
|
-
forbiddenSuffixes?: string[];
|
54
|
-
};
|
55
|
-
[x: `VariableDefinition${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: `Argument${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: `FragmentDefinition${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: `ScalarTypeDefinition${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: `ObjectTypeDefinition${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: `FieldDefinition${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: `InputValueDefinition${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: `InterfaceTypeDefinition${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: `UnionTypeDefinition${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: `EnumTypeDefinition${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: `EnumValueDefinition${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: `InputObjectTypeDefinition${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: `DirectiveDefinition${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
|
-
}], false>;
|
18
|
+
'match-document-filename': import("..").GraphQLESLintRule<[import("./match-document-filename").MatchDocumentFilenameRuleConfig], false>;
|
19
|
+
'naming-convention': import("..").GraphQLESLintRule<[import("./naming-convention").NamingConventionRuleConfig], false>;
|
147
20
|
'no-anonymous-operations': import("..").GraphQLESLintRule<any[], false>;
|
148
21
|
'no-case-insensitive-enum-values-duplicates': import("..").GraphQLESLintRule<any[], false>;
|
149
22
|
'no-deprecated': import("..").GraphQLESLintRule<[], true>;
|
@@ -2,10 +2,10 @@ import { CaseStyle } from '../utils';
|
|
2
2
|
import { GraphQLESLintRule } from '../types';
|
3
3
|
declare const ACCEPTED_EXTENSIONS: ['.gql', '.graphql'];
|
4
4
|
declare type PropertySchema = {
|
5
|
-
style
|
6
|
-
suffix
|
5
|
+
style?: CaseStyle;
|
6
|
+
suffix?: string;
|
7
7
|
};
|
8
|
-
declare type MatchDocumentFilenameRuleConfig = {
|
8
|
+
export declare type MatchDocumentFilenameRuleConfig = {
|
9
9
|
fileExtension?: typeof ACCEPTED_EXTENSIONS[number];
|
10
10
|
query?: CaseStyle | PropertySchema;
|
11
11
|
mutation?: CaseStyle | PropertySchema;
|
@@ -25,7 +25,7 @@ declare type PropertySchema = {
|
|
25
25
|
forbiddenSuffixes?: string[];
|
26
26
|
};
|
27
27
|
declare type Options = AllowedStyle | PropertySchema;
|
28
|
-
declare type NamingConventionRuleConfig = {
|
28
|
+
export declare type NamingConventionRuleConfig = {
|
29
29
|
allowLeadingUnderscore?: boolean;
|
30
30
|
allowTrailingUnderscore?: boolean;
|
31
31
|
types?: Options;
|
package/types.d.ts
CHANGED
package/utils.d.ts
CHANGED
@@ -6,6 +6,7 @@ import { SiblingOperations } from './sibling-operations';
|
|
6
6
|
import { UsedFields, ReachableTypes } from './graphql-ast';
|
7
7
|
export declare function requireSiblingsOperations(ruleName: string, context: GraphQLESLintRuleContext): SiblingOperations | never;
|
8
8
|
export declare function requireGraphQLSchemaFromContext(ruleName: string, context: GraphQLESLintRuleContext): GraphQLSchema | never;
|
9
|
+
export declare function getGraphQLSchemaToExtend(context: GraphQLESLintRuleContext): GraphQLSchema | null;
|
9
10
|
export declare function requireReachableTypesFromContext(ruleName: string, context: GraphQLESLintRuleContext): ReachableTypes | never;
|
10
11
|
export declare function requireUsedFieldsFromContext(ruleName: string, context: GraphQLESLintRuleContext): UsedFields | never;
|
11
12
|
export declare function extractTokens(source: Source): AST.Token[];
|
@@ -20,13 +21,7 @@ export declare const getOnDiskFilepath: (filepath: string) => string;
|
|
20
21
|
export declare const getTypeName: (node: any) => any;
|
21
22
|
export declare const loaderCache: Record<string, LoaderSource[]>;
|
22
23
|
export declare const TYPES_KINDS: readonly [Kind.OBJECT_TYPE_DEFINITION, Kind.INTERFACE_TYPE_DEFINITION, Kind.ENUM_TYPE_DEFINITION, Kind.SCALAR_TYPE_DEFINITION, Kind.INPUT_OBJECT_TYPE_DEFINITION, Kind.UNION_TYPE_DEFINITION];
|
23
|
-
export declare
|
24
|
-
camelCase = "camelCase",
|
25
|
-
pascalCase = "PascalCase",
|
26
|
-
snakeCase = "snake_case",
|
27
|
-
upperCase = "UPPER_CASE",
|
28
|
-
kebabCase = "kebab-case"
|
29
|
-
}
|
24
|
+
export declare type CaseStyle = 'camelCase' | 'PascalCase' | 'snake_case' | 'UPPER_CASE' | 'kebab-case';
|
30
25
|
export declare const camelCase: (str: string) => string;
|
31
26
|
export declare const convertCase: (style: CaseStyle, str: string) => string;
|
32
27
|
export declare function getLocation(loc: Partial<AST.SourceLocation>, fieldName?: string, offset?: {
|