@graphql-eslint/eslint-plugin 2.4.0-alpha-702309a.0 → 2.4.0-alpha-a3f52b6.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/custom-rules.md +1 -1
- package/docs/rules/avoid-duplicate-fields.md +9 -7
- package/docs/rules/fragments-on-composite-type.md +2 -2
- package/docs/rules/one-field-subscriptions.md +2 -2
- package/docs/rules/possible-fragment-spread.md +2 -2
- package/docs/rules/possible-type-extension.md +2 -2
- package/docs/rules/unique-directive-names-per-location.md +2 -2
- package/docs/rules/value-literals-of-correct-type.md +2 -2
- package/index.js +239 -190
- package/index.mjs +239 -190
- package/package.json +1 -1
- package/rules/alphabetize.d.ts +6 -5
- package/rules/avoid-duplicate-fields.d.ts +1 -1
- package/rules/index.d.ts +7 -7
- package/rules/require-description.d.ts +2 -1
- package/testkit.d.ts +6 -3
- package/types.d.ts +1 -0
- package/utils.d.ts +4 -1
package/package.json
CHANGED
package/rules/alphabetize.d.ts
CHANGED
@@ -1,9 +1,10 @@
|
|
1
|
+
import { Kind } from 'graphql';
|
1
2
|
import { GraphQLESLintRule } from '../types';
|
2
|
-
declare const fieldsEnum:
|
3
|
-
declare const valuesEnum:
|
4
|
-
declare const selectionsEnum:
|
5
|
-
declare const variablesEnum:
|
6
|
-
declare const argumentsEnum:
|
3
|
+
declare const fieldsEnum: Kind[];
|
4
|
+
declare const valuesEnum: Kind[];
|
5
|
+
declare const selectionsEnum: Kind[];
|
6
|
+
declare const variablesEnum: Kind[];
|
7
|
+
declare const argumentsEnum: Kind[];
|
7
8
|
declare type AlphabetizeConfig = [
|
8
9
|
{
|
9
10
|
fields?: typeof fieldsEnum;
|
package/rules/index.d.ts
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
export declare const rules: {
|
2
2
|
alphabetize: import("..").GraphQLESLintRule<[{
|
3
|
-
fields?: ("
|
4
|
-
values?: "
|
5
|
-
selections?: ("
|
6
|
-
variables?: "
|
7
|
-
arguments?: ("
|
3
|
+
fields?: import("graphql").Kind[];
|
4
|
+
values?: import("graphql").Kind[];
|
5
|
+
selections?: import("graphql").Kind[];
|
6
|
+
variables?: import("graphql").Kind[];
|
7
|
+
arguments?: import("graphql").Kind[];
|
8
8
|
}], false>;
|
9
|
-
'avoid-duplicate-fields': import("..").GraphQLESLintRule<[], false>;
|
9
|
+
'avoid-duplicate-fields': import("..").GraphQLESLintRule<any[], false>;
|
10
10
|
'avoid-operation-name-prefix': import("..").GraphQLESLintRule<import("./avoid-operation-name-prefix").AvoidOperationNamePrefixConfig, false>;
|
11
11
|
'avoid-scalar-result-type-on-mutation': import("..").GraphQLESLintRule<any[], false>;
|
12
12
|
'avoid-typename-prefix': import("..").GraphQLESLintRule<any[], false>;
|
@@ -66,7 +66,7 @@ export declare const rules: {
|
|
66
66
|
}], false>;
|
67
67
|
'require-deprecation-reason': import("..").GraphQLESLintRule<any[], false>;
|
68
68
|
'require-description': import("..").GraphQLESLintRule<[{
|
69
|
-
on: ("
|
69
|
+
on: import("graphql").Kind[];
|
70
70
|
}], false>;
|
71
71
|
'require-field-of-type-query-in-mutation-result': import("..").GraphQLESLintRule<any[], false>;
|
72
72
|
'require-id-when-available': import("..").GraphQLESLintRule<[{
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { GraphQLESLintRule } from '../types';
|
2
|
-
|
2
|
+
import { Kind } from 'graphql';
|
3
|
+
declare const DESCRIBABLE_NODES: Kind[];
|
3
4
|
declare type RequireDescriptionRuleConfig = [{
|
4
5
|
on: typeof DESCRIBABLE_NODES;
|
5
6
|
}];
|
package/testkit.d.ts
CHANGED
@@ -6,6 +6,7 @@ export declare type GraphQLESLintRuleListener<WithTypeInfo extends boolean = fal
|
|
6
6
|
[K in keyof ASTKindToNode]?: (node: GraphQLESTreeNode<ASTKindToNode[K], WithTypeInfo>) => void;
|
7
7
|
} & Record<string, any>;
|
8
8
|
export declare type GraphQLValidTestCase<Options> = Omit<RuleTester.ValidTestCase, 'options' | 'parserOptions'> & {
|
9
|
+
name: string;
|
9
10
|
options?: Options;
|
10
11
|
parserOptions?: ParserOptions;
|
11
12
|
};
|
@@ -13,8 +14,11 @@ export declare type GraphQLInvalidTestCase<T> = GraphQLValidTestCase<T> & {
|
|
13
14
|
errors: number | Array<RuleTester.TestCaseError | string>;
|
14
15
|
output?: string | null;
|
15
16
|
};
|
16
|
-
declare
|
17
|
-
|
17
|
+
export declare class GraphQLRuleTester extends RuleTester {
|
18
|
+
config: {
|
19
|
+
parser: string;
|
20
|
+
parserOptions: ParserOptions;
|
21
|
+
};
|
18
22
|
constructor(parserOptions?: ParserOptions);
|
19
23
|
fromMockFile(path: string): string;
|
20
24
|
runGraphQLTests<Config>(name: string, rule: GraphQLESLintRule, tests: {
|
@@ -22,4 +26,3 @@ export declare class GraphQLRuleTester extends GraphQLRuleTester_base {
|
|
22
26
|
invalid: GraphQLInvalidTestCase<Config>[];
|
23
27
|
}): void;
|
24
28
|
}
|
25
|
-
export {};
|
package/types.d.ts
CHANGED
package/utils.d.ts
CHANGED
@@ -31,7 +31,10 @@ export declare enum CaseStyle {
|
|
31
31
|
upperCase = "UPPER_CASE",
|
32
32
|
kebabCase = "kebab-case"
|
33
33
|
}
|
34
|
-
export declare const pascalCase: (str: string) => string;
|
35
34
|
export declare const camelCase: (str: string) => string;
|
36
35
|
export declare const convertCase: (style: CaseStyle, str: string) => string;
|
36
|
+
export declare function getLocation(loc: Partial<AST.SourceLocation>, fieldName?: string, offset?: {
|
37
|
+
offsetStart?: number;
|
38
|
+
offsetEnd?: number;
|
39
|
+
}): AST.SourceLocation;
|
37
40
|
export {};
|