@graphql-eslint/eslint-plugin 3.14.3 → 3.14.4-alpha-20221229152648-0a153c6
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/cache.js +3 -2
- package/cjs/documents.js +8 -5
- package/cjs/estree-converter/converter.js +1 -1
- package/cjs/parser.js +4 -2
- package/cjs/processor.js +4 -2
- package/cjs/rules/alphabetize.js +5 -3
- package/cjs/rules/graphql-js-validation.js +9 -6
- package/cjs/rules/input-name.js +5 -4
- package/cjs/rules/naming-convention.js +2 -2
- package/cjs/rules/no-case-insensitive-enum-values-duplicates.js +3 -2
- package/cjs/rules/no-duplicate-fields.js +2 -2
- package/cjs/rules/no-hashtag-description.js +3 -0
- package/cjs/rules/no-root-type.js +1 -1
- package/cjs/rules/no-typename-prefix.js +1 -1
- package/cjs/rules/no-unreachable-types.js +1 -1
- package/cjs/rules/relay-arguments.js +2 -1
- package/cjs/rules/relay-connection-types.js +2 -2
- package/cjs/rules/relay-edge-types.js +7 -4
- package/cjs/rules/relay-page-info.js +2 -1
- package/cjs/rules/require-deprecation-date.js +2 -2
- package/cjs/rules/require-deprecation-reason.js +2 -1
- package/cjs/rules/require-description.js +1 -1
- package/cjs/rules/require-field-of-type-query-in-mutation-result.js +1 -1
- package/cjs/rules/require-id-when-available.js +2 -1
- package/cjs/rules/require-nullable-fields-with-oneof.js +2 -2
- package/cjs/rules/require-type-pattern-with-oneof.js +2 -1
- package/cjs/rules/strict-id-in-types.js +4 -4
- package/cjs/rules/unique-fragment-name.js +1 -0
- package/cjs/schema.js +3 -1
- package/cjs/testkit.js +4 -7
- package/cjs/utils.js +11 -5
- package/esm/cache.js +3 -2
- package/esm/documents.js +8 -5
- package/esm/estree-converter/converter.js +1 -1
- package/esm/graphql-config.js +1 -1
- package/esm/parser.js +4 -2
- package/esm/processor.js +5 -3
- package/esm/rules/alphabetize.js +6 -4
- package/esm/rules/graphql-js-validation.js +9 -6
- package/esm/rules/input-name.js +5 -4
- package/esm/rules/naming-convention.js +3 -3
- package/esm/rules/no-case-insensitive-enum-values-duplicates.js +3 -2
- package/esm/rules/no-duplicate-fields.js +2 -2
- package/esm/rules/no-hashtag-description.js +3 -0
- package/esm/rules/no-root-type.js +2 -2
- package/esm/rules/no-typename-prefix.js +1 -1
- package/esm/rules/no-unreachable-types.js +1 -1
- package/esm/rules/relay-arguments.js +2 -1
- package/esm/rules/relay-connection-types.js +2 -2
- package/esm/rules/relay-edge-types.js +7 -4
- package/esm/rules/relay-page-info.js +2 -1
- package/esm/rules/require-deprecation-date.js +2 -2
- package/esm/rules/require-deprecation-reason.js +2 -1
- package/esm/rules/require-description.js +1 -1
- package/esm/rules/require-field-of-type-query-in-mutation-result.js +1 -1
- package/esm/rules/require-id-when-available.js +2 -1
- package/esm/rules/require-nullable-fields-with-oneof.js +2 -2
- package/esm/rules/require-type-pattern-with-oneof.js +2 -1
- package/esm/rules/strict-id-in-types.js +5 -5
- package/esm/rules/unique-fragment-name.js +1 -0
- package/esm/schema.js +3 -1
- package/esm/testkit.js +4 -7
- package/esm/utils.js +9 -4
- package/package.json +1 -1
- package/typings/cache.d.cts +1 -1
- package/typings/cache.d.ts +1 -1
- package/typings/estree-converter/types.d.cts +4 -4
- package/typings/estree-converter/types.d.ts +4 -4
- package/typings/estree-converter/utils.d.cts +2 -2
- package/typings/estree-converter/utils.d.ts +2 -2
- package/typings/rules/index.d.cts +68 -68
- package/typings/rules/index.d.ts +68 -68
- package/typings/testkit.d.cts +6 -4
- package/typings/testkit.d.ts +6 -4
- package/typings/types.d.cts +4 -3
- package/typings/types.d.ts +4 -3
- package/typings/utils.d.cts +8 -5
- package/typings/utils.d.ts +8 -5
package/typings/cache.d.cts
CHANGED
package/typings/cache.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ASTNode, TypeInfo, TypeNode, DocumentNode, ExecutableDefinitionNode, NameNode, TypeDefinitionNode, FieldDefinitionNode, ObjectTypeExtensionNode, ObjectTypeDefinitionNode, InterfaceTypeDefinitionNode, InterfaceTypeExtensionNode, SelectionSetNode, SelectionNode, DefinitionNode, TypeExtensionNode, DirectiveDefinitionNode, VariableNode, FieldNode, FragmentSpreadNode, EnumValueDefinitionNode, ArgumentNode, NamedTypeNode, EnumTypeDefinitionNode, EnumTypeExtensionNode, InputValueDefinitionNode, InputObjectTypeDefinitionNode, InputObjectTypeExtensionNode, InlineFragmentNode, VariableDefinitionNode, ListTypeNode, NonNullTypeNode, OperationTypeDefinitionNode } from 'graphql';
|
1
|
+
import { ASTNode, TypeInfo, TypeNode, DocumentNode, ExecutableDefinitionNode, NameNode, TypeDefinitionNode, FieldDefinitionNode, ObjectTypeExtensionNode, ObjectTypeDefinitionNode, InterfaceTypeDefinitionNode, InterfaceTypeExtensionNode, SelectionSetNode, SelectionNode, DefinitionNode, TypeExtensionNode, DirectiveDefinitionNode, VariableNode, FieldNode, FragmentSpreadNode, EnumValueDefinitionNode, ArgumentNode, NamedTypeNode, EnumTypeDefinitionNode, EnumTypeExtensionNode, InputValueDefinitionNode, InputObjectTypeDefinitionNode, InputObjectTypeExtensionNode, InlineFragmentNode, VariableDefinitionNode, ListTypeNode, NonNullTypeNode, OperationTypeDefinitionNode, DirectiveNode } from 'graphql';
|
2
2
|
import { SourceLocation, Comment } from 'estree';
|
3
3
|
import { AST } from 'eslint';
|
4
4
|
type SafeGraphQLType<T extends ASTNode> = T extends {
|
@@ -22,7 +22,7 @@ export type TypeInformation = {
|
|
22
22
|
};
|
23
23
|
type NodeWithName = TypeDefinitionNode | TypeExtensionNode | ExecutableDefinitionNode | DirectiveDefinitionNode | FieldDefinitionNode | EnumValueDefinitionNode | FieldNode | FragmentSpreadNode | VariableNode | ArgumentNode | NamedTypeNode;
|
24
24
|
type NodeWithType = FieldDefinitionNode | InputValueDefinitionNode | OperationTypeDefinitionNode | NonNullTypeNode | ListTypeNode | VariableDefinitionNode;
|
25
|
-
type ParentNode<T> = T extends DocumentNode ? AST.Program : T extends DefinitionNode ? DocumentNode : T extends EnumValueDefinitionNode ? EnumTypeDefinitionNode | EnumTypeExtensionNode : T extends InputValueDefinitionNode ? InputObjectTypeDefinitionNode | InputObjectTypeExtensionNode | FieldDefinitionNode | DirectiveDefinitionNode : T extends FieldDefinitionNode ? ObjectTypeDefinitionNode | ObjectTypeExtensionNode | InterfaceTypeDefinitionNode | InterfaceTypeExtensionNode : T extends SelectionSetNode ? ExecutableDefinitionNode | FieldNode | InlineFragmentNode : T extends SelectionNode ? SelectionSetNode : T extends TypeNode ? NodeWithType : T extends NameNode ? NodeWithName : unknown;
|
25
|
+
type ParentNode<T> = T extends DocumentNode ? AST.Program : T extends DefinitionNode ? DocumentNode : T extends EnumValueDefinitionNode ? EnumTypeDefinitionNode | EnumTypeExtensionNode : T extends InputValueDefinitionNode ? InputObjectTypeDefinitionNode | InputObjectTypeExtensionNode | FieldDefinitionNode | DirectiveDefinitionNode : T extends FieldDefinitionNode ? ObjectTypeDefinitionNode | ObjectTypeExtensionNode | InterfaceTypeDefinitionNode | InterfaceTypeExtensionNode : T extends SelectionSetNode ? ExecutableDefinitionNode | FieldNode | InlineFragmentNode : T extends SelectionNode ? SelectionSetNode : T extends TypeNode ? NodeWithType : T extends NameNode ? NodeWithName : T extends DirectiveNode ? InputObjectTypeDefinitionNode | ObjectTypeDefinitionNode : T extends VariableNode ? VariableDefinitionNode : unknown;
|
26
26
|
type Node<T extends ASTNode, WithTypeInfo extends boolean> = Writeable<SafeGraphQLType<T>> & {
|
27
27
|
type: T['kind'];
|
28
28
|
loc: SourceLocation;
|
@@ -30,10 +30,10 @@ type Node<T extends ASTNode, WithTypeInfo extends boolean> = Writeable<SafeGraph
|
|
30
30
|
leadingComments: Comment[];
|
31
31
|
typeInfo: () => WithTypeInfo extends true ? TypeInformation : Record<string, never>;
|
32
32
|
rawNode: () => T;
|
33
|
-
parent: ParentNode<T
|
33
|
+
parent: GraphQLESTreeNode<ParentNode<T>>;
|
34
34
|
};
|
35
35
|
export type GraphQLESTreeNode<T, W extends boolean = false> = T extends ASTNode ? {
|
36
|
-
[K in keyof Node<T, W>]: Node<T, W>[K] extends ReadonlyArray<infer ArrayItem> ? GraphQLESTreeNode<ArrayItem, W>[] : GraphQLESTreeNode<Node<T, W>[K], W>;
|
36
|
+
[K in keyof Node<T, W>]: Node<T, W>[K] extends ReadonlyArray<infer ArrayItem> | undefined ? GraphQLESTreeNode<ArrayItem, W>[] : GraphQLESTreeNode<Node<T, W>[K], W>;
|
37
37
|
} : T extends AST.Program ? T & {
|
38
38
|
parent: null;
|
39
39
|
} : T;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ASTNode, TypeInfo, TypeNode, DocumentNode, ExecutableDefinitionNode, NameNode, TypeDefinitionNode, FieldDefinitionNode, ObjectTypeExtensionNode, ObjectTypeDefinitionNode, InterfaceTypeDefinitionNode, InterfaceTypeExtensionNode, SelectionSetNode, SelectionNode, DefinitionNode, TypeExtensionNode, DirectiveDefinitionNode, VariableNode, FieldNode, FragmentSpreadNode, EnumValueDefinitionNode, ArgumentNode, NamedTypeNode, EnumTypeDefinitionNode, EnumTypeExtensionNode, InputValueDefinitionNode, InputObjectTypeDefinitionNode, InputObjectTypeExtensionNode, InlineFragmentNode, VariableDefinitionNode, ListTypeNode, NonNullTypeNode, OperationTypeDefinitionNode } from 'graphql';
|
1
|
+
import { ASTNode, TypeInfo, TypeNode, DocumentNode, ExecutableDefinitionNode, NameNode, TypeDefinitionNode, FieldDefinitionNode, ObjectTypeExtensionNode, ObjectTypeDefinitionNode, InterfaceTypeDefinitionNode, InterfaceTypeExtensionNode, SelectionSetNode, SelectionNode, DefinitionNode, TypeExtensionNode, DirectiveDefinitionNode, VariableNode, FieldNode, FragmentSpreadNode, EnumValueDefinitionNode, ArgumentNode, NamedTypeNode, EnumTypeDefinitionNode, EnumTypeExtensionNode, InputValueDefinitionNode, InputObjectTypeDefinitionNode, InputObjectTypeExtensionNode, InlineFragmentNode, VariableDefinitionNode, ListTypeNode, NonNullTypeNode, OperationTypeDefinitionNode, DirectiveNode } from 'graphql';
|
2
2
|
import { SourceLocation, Comment } from 'estree';
|
3
3
|
import { AST } from 'eslint';
|
4
4
|
type SafeGraphQLType<T extends ASTNode> = T extends {
|
@@ -22,7 +22,7 @@ export type TypeInformation = {
|
|
22
22
|
};
|
23
23
|
type NodeWithName = TypeDefinitionNode | TypeExtensionNode | ExecutableDefinitionNode | DirectiveDefinitionNode | FieldDefinitionNode | EnumValueDefinitionNode | FieldNode | FragmentSpreadNode | VariableNode | ArgumentNode | NamedTypeNode;
|
24
24
|
type NodeWithType = FieldDefinitionNode | InputValueDefinitionNode | OperationTypeDefinitionNode | NonNullTypeNode | ListTypeNode | VariableDefinitionNode;
|
25
|
-
type ParentNode<T> = T extends DocumentNode ? AST.Program : T extends DefinitionNode ? DocumentNode : T extends EnumValueDefinitionNode ? EnumTypeDefinitionNode | EnumTypeExtensionNode : T extends InputValueDefinitionNode ? InputObjectTypeDefinitionNode | InputObjectTypeExtensionNode | FieldDefinitionNode | DirectiveDefinitionNode : T extends FieldDefinitionNode ? ObjectTypeDefinitionNode | ObjectTypeExtensionNode | InterfaceTypeDefinitionNode | InterfaceTypeExtensionNode : T extends SelectionSetNode ? ExecutableDefinitionNode | FieldNode | InlineFragmentNode : T extends SelectionNode ? SelectionSetNode : T extends TypeNode ? NodeWithType : T extends NameNode ? NodeWithName : unknown;
|
25
|
+
type ParentNode<T> = T extends DocumentNode ? AST.Program : T extends DefinitionNode ? DocumentNode : T extends EnumValueDefinitionNode ? EnumTypeDefinitionNode | EnumTypeExtensionNode : T extends InputValueDefinitionNode ? InputObjectTypeDefinitionNode | InputObjectTypeExtensionNode | FieldDefinitionNode | DirectiveDefinitionNode : T extends FieldDefinitionNode ? ObjectTypeDefinitionNode | ObjectTypeExtensionNode | InterfaceTypeDefinitionNode | InterfaceTypeExtensionNode : T extends SelectionSetNode ? ExecutableDefinitionNode | FieldNode | InlineFragmentNode : T extends SelectionNode ? SelectionSetNode : T extends TypeNode ? NodeWithType : T extends NameNode ? NodeWithName : T extends DirectiveNode ? InputObjectTypeDefinitionNode | ObjectTypeDefinitionNode : T extends VariableNode ? VariableDefinitionNode : unknown;
|
26
26
|
type Node<T extends ASTNode, WithTypeInfo extends boolean> = Writeable<SafeGraphQLType<T>> & {
|
27
27
|
type: T['kind'];
|
28
28
|
loc: SourceLocation;
|
@@ -30,10 +30,10 @@ type Node<T extends ASTNode, WithTypeInfo extends boolean> = Writeable<SafeGraph
|
|
30
30
|
leadingComments: Comment[];
|
31
31
|
typeInfo: () => WithTypeInfo extends true ? TypeInformation : Record<string, never>;
|
32
32
|
rawNode: () => T;
|
33
|
-
parent: ParentNode<T
|
33
|
+
parent: GraphQLESTreeNode<ParentNode<T>>;
|
34
34
|
};
|
35
35
|
export type GraphQLESTreeNode<T, W extends boolean = false> = T extends ASTNode ? {
|
36
|
-
[K in keyof Node<T, W>]: Node<T, W>[K] extends ReadonlyArray<infer ArrayItem> ? GraphQLESTreeNode<ArrayItem, W>[] : GraphQLESTreeNode<Node<T, W>[K], W>;
|
36
|
+
[K in keyof Node<T, W>]: Node<T, W>[K] extends ReadonlyArray<infer ArrayItem> | undefined ? GraphQLESTreeNode<ArrayItem, W>[] : GraphQLESTreeNode<Node<T, W>[K], W>;
|
37
37
|
} : T extends AST.Program ? T & {
|
38
38
|
parent: null;
|
39
39
|
} : T;
|
@@ -1,13 +1,13 @@
|
|
1
1
|
import { Location, GraphQLOutputType, GraphQLNamedType, Token } from 'graphql';
|
2
2
|
import { Comment, SourceLocation } from 'estree';
|
3
3
|
import { AST } from 'eslint';
|
4
|
-
export declare const valueFromNode: (valueNode: import("graphql").ValueNode, variables?: import("graphql/jsutils/ObjMap").ObjMap<unknown
|
4
|
+
export declare const valueFromNode: (valueNode: import("graphql").ValueNode, variables?: import("graphql/jsutils/Maybe").Maybe<import("graphql/jsutils/ObjMap").ObjMap<unknown>>) => any;
|
5
5
|
export declare function getBaseType(type: GraphQLOutputType): GraphQLNamedType;
|
6
6
|
type TokenKindValue = '<SOF>' | '!' | '$' | '&' | '(' | ')' | '...' | ':' | '=' | '@' | '[' | ']' | '{' | '|' | '}' | 'Name' | 'Int' | 'Float' | 'String' | 'BlockString' | 'Comment';
|
7
7
|
export declare function convertToken<T extends 'Line' | 'Block' | TokenKindValue>(token: Token, type: T): Omit<AST.Token, 'type'> & {
|
8
8
|
type: T;
|
9
9
|
};
|
10
10
|
export declare function extractTokens(filePath: string, code: string): AST.Token[];
|
11
|
-
export declare function extractComments(loc
|
11
|
+
export declare function extractComments(loc?: Location): Comment[];
|
12
12
|
export declare function convertLocation(location: Location): SourceLocation;
|
13
13
|
export {};
|
@@ -1,13 +1,13 @@
|
|
1
1
|
import { Location, GraphQLOutputType, GraphQLNamedType, Token } from 'graphql';
|
2
2
|
import { Comment, SourceLocation } from 'estree';
|
3
3
|
import { AST } from 'eslint';
|
4
|
-
export declare const valueFromNode: (valueNode: import("graphql").ValueNode, variables?: import("graphql/jsutils/ObjMap").ObjMap<unknown
|
4
|
+
export declare const valueFromNode: (valueNode: import("graphql").ValueNode, variables?: import("graphql/jsutils/Maybe").Maybe<import("graphql/jsutils/ObjMap").ObjMap<unknown>>) => any;
|
5
5
|
export declare function getBaseType(type: GraphQLOutputType): GraphQLNamedType;
|
6
6
|
type TokenKindValue = '<SOF>' | '!' | '$' | '&' | '(' | ')' | '...' | ':' | '=' | '@' | '[' | ']' | '{' | '|' | '}' | 'Name' | 'Int' | 'Float' | 'String' | 'BlockString' | 'Comment';
|
7
7
|
export declare function convertToken<T extends 'Line' | 'Block' | TokenKindValue>(token: Token, type: T): Omit<AST.Token, 'type'> & {
|
8
8
|
type: T;
|
9
9
|
};
|
10
10
|
export declare function extractTokens(filePath: string, code: string): AST.Token[];
|
11
|
-
export declare function extractComments(loc
|
11
|
+
export declare function extractComments(loc?: Location): Comment[];
|
12
12
|
export declare function convertLocation(location: Location): SourceLocation;
|
13
13
|
export {};
|
@@ -1,107 +1,107 @@
|
|
1
1
|
export declare const rules: {
|
2
2
|
alphabetize: import("../types.js").GraphQLESLintRule<{
|
3
|
-
definitions?: boolean;
|
4
|
-
selections?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<"OperationDefinition" | "FragmentDefinition">[];
|
5
|
-
arguments?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<"Field" | "Directive" | "FieldDefinition" | "DirectiveDefinition">[];
|
6
|
-
values?: "EnumTypeDefinition"[];
|
7
|
-
fields?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<"ObjectTypeDefinition" | "InterfaceTypeDefinition" | "InputObjectTypeDefinition">[];
|
8
|
-
variables?: "OperationDefinition"[];
|
9
|
-
groups?: string[];
|
3
|
+
definitions?: boolean | undefined;
|
4
|
+
selections?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<"OperationDefinition" | "FragmentDefinition">[] | undefined;
|
5
|
+
arguments?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<"Field" | "Directive" | "FieldDefinition" | "DirectiveDefinition">[] | undefined;
|
6
|
+
values?: "EnumTypeDefinition"[] | undefined;
|
7
|
+
fields?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<"ObjectTypeDefinition" | "InterfaceTypeDefinition" | "InputObjectTypeDefinition">[] | undefined;
|
8
|
+
variables?: "OperationDefinition"[] | undefined;
|
9
|
+
groups?: string[] | undefined;
|
10
10
|
}[], false>;
|
11
11
|
'description-style': import("../types.js").GraphQLESLintRule<{
|
12
|
-
style?: "block" | "inline";
|
12
|
+
style?: "block" | "inline" | undefined;
|
13
13
|
}[], false>;
|
14
14
|
'input-name': import("../types.js").GraphQLESLintRule<{
|
15
|
-
checkInputType?: boolean;
|
16
|
-
caseSensitiveInputType?: boolean;
|
17
|
-
checkQueries?: boolean;
|
18
|
-
checkMutations?: boolean;
|
15
|
+
checkInputType?: boolean | undefined;
|
16
|
+
caseSensitiveInputType?: boolean | undefined;
|
17
|
+
checkQueries?: boolean | undefined;
|
18
|
+
checkMutations?: boolean | undefined;
|
19
19
|
}[], false>;
|
20
20
|
'lone-executable-definition': import("../types.js").GraphQLESLintRule<{
|
21
|
-
ignore?: ("fragment" | "query" | "mutation" | "subscription")[];
|
21
|
+
ignore?: ("fragment" | "query" | "mutation" | "subscription")[] | undefined;
|
22
22
|
}[], false>;
|
23
23
|
'match-document-filename': import("../types.js").GraphQLESLintRule<{
|
24
24
|
fragment?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<import("../utils.js").CaseStyle | "matchDocumentStyle"> | {
|
25
|
-
style?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<import("../utils.js").CaseStyle | "matchDocumentStyle"
|
26
|
-
suffix?: string;
|
27
|
-
prefix?: string;
|
28
|
-
};
|
25
|
+
style?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<import("../utils.js").CaseStyle | "matchDocumentStyle"> | undefined;
|
26
|
+
suffix?: string | undefined;
|
27
|
+
prefix?: string | undefined;
|
28
|
+
} | undefined;
|
29
29
|
query?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<import("../utils.js").CaseStyle | "matchDocumentStyle"> | {
|
30
|
-
style?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<import("../utils.js").CaseStyle | "matchDocumentStyle"
|
31
|
-
suffix?: string;
|
32
|
-
prefix?: string;
|
33
|
-
};
|
30
|
+
style?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<import("../utils.js").CaseStyle | "matchDocumentStyle"> | undefined;
|
31
|
+
suffix?: string | undefined;
|
32
|
+
prefix?: string | undefined;
|
33
|
+
} | undefined;
|
34
34
|
mutation?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<import("../utils.js").CaseStyle | "matchDocumentStyle"> | {
|
35
|
-
style?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<import("../utils.js").CaseStyle | "matchDocumentStyle"
|
36
|
-
suffix?: string;
|
37
|
-
prefix?: string;
|
38
|
-
};
|
35
|
+
style?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<import("../utils.js").CaseStyle | "matchDocumentStyle"> | undefined;
|
36
|
+
suffix?: string | undefined;
|
37
|
+
prefix?: string | undefined;
|
38
|
+
} | undefined;
|
39
39
|
subscription?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<import("../utils.js").CaseStyle | "matchDocumentStyle"> | {
|
40
|
-
style?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<import("../utils.js").CaseStyle | "matchDocumentStyle"
|
41
|
-
suffix?: string;
|
42
|
-
prefix?: string;
|
43
|
-
};
|
44
|
-
fileExtension?: ".gql" | ".graphql";
|
40
|
+
style?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<import("../utils.js").CaseStyle | "matchDocumentStyle"> | undefined;
|
41
|
+
suffix?: string | undefined;
|
42
|
+
prefix?: string | undefined;
|
43
|
+
} | undefined;
|
44
|
+
fileExtension?: ".gql" | ".graphql" | undefined;
|
45
45
|
}[], false>;
|
46
46
|
'naming-convention': import("../types.js").GraphQLESLintRule<{
|
47
47
|
[x: string]: unknown;
|
48
48
|
types?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<"camelCase" | "PascalCase" | "snake_case" | "UPPER_CASE"> | {
|
49
|
-
style?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<"camelCase" | "PascalCase" | "snake_case" | "UPPER_CASE"
|
50
|
-
suffix?: string;
|
51
|
-
prefix?: string;
|
52
|
-
forbiddenPrefixes?: string[];
|
53
|
-
forbiddenSuffixes?: string[];
|
54
|
-
ignorePattern?: string;
|
55
|
-
};
|
56
|
-
allowLeadingUnderscore?: boolean;
|
57
|
-
allowTrailingUnderscore?: boolean;
|
49
|
+
style?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<"camelCase" | "PascalCase" | "snake_case" | "UPPER_CASE"> | undefined;
|
50
|
+
suffix?: string | undefined;
|
51
|
+
prefix?: string | undefined;
|
52
|
+
forbiddenPrefixes?: string[] | undefined;
|
53
|
+
forbiddenSuffixes?: string[] | undefined;
|
54
|
+
ignorePattern?: string | undefined;
|
55
|
+
} | undefined;
|
56
|
+
allowLeadingUnderscore?: boolean | undefined;
|
57
|
+
allowTrailingUnderscore?: boolean | undefined;
|
58
58
|
}[], false>;
|
59
|
-
'no-anonymous-operations': import("../types.js").GraphQLESLintRule<
|
60
|
-
'no-case-insensitive-enum-values-duplicates': import("../types.js").GraphQLESLintRule<
|
59
|
+
'no-anonymous-operations': import("../types.js").GraphQLESLintRule<[], false>;
|
60
|
+
'no-case-insensitive-enum-values-duplicates': import("../types.js").GraphQLESLintRule<[], false>;
|
61
61
|
'no-deprecated': import("../types.js").GraphQLESLintRule<[], true>;
|
62
|
-
'no-duplicate-fields': import("../types.js").GraphQLESLintRule<
|
63
|
-
'no-hashtag-description': import("../types.js").GraphQLESLintRule<
|
64
|
-
'no-one-place-fragments': import("../types.js").GraphQLESLintRule<
|
62
|
+
'no-duplicate-fields': import("../types.js").GraphQLESLintRule<[], false>;
|
63
|
+
'no-hashtag-description': import("../types.js").GraphQLESLintRule<[], false>;
|
64
|
+
'no-one-place-fragments': import("../types.js").GraphQLESLintRule<[], false>;
|
65
65
|
'no-root-type': import("../types.js").GraphQLESLintRule<{
|
66
66
|
disallow: ("mutation" | "subscription")[];
|
67
67
|
}[], false>;
|
68
|
-
'no-scalar-result-type-on-mutation': import("../types.js").GraphQLESLintRule<
|
69
|
-
'no-typename-prefix': import("../types.js").GraphQLESLintRule<
|
70
|
-
'no-unreachable-types': import("../types.js").GraphQLESLintRule<
|
71
|
-
'no-unused-fields': import("../types.js").GraphQLESLintRule<
|
68
|
+
'no-scalar-result-type-on-mutation': import("../types.js").GraphQLESLintRule<[], false>;
|
69
|
+
'no-typename-prefix': import("../types.js").GraphQLESLintRule<[], false>;
|
70
|
+
'no-unreachable-types': import("../types.js").GraphQLESLintRule<[], false>;
|
71
|
+
'no-unused-fields': import("../types.js").GraphQLESLintRule<[], false>;
|
72
72
|
'relay-arguments': import("../types.js").GraphQLESLintRule<{
|
73
|
-
includeBoth?: boolean;
|
73
|
+
includeBoth?: boolean | undefined;
|
74
74
|
}[], true>;
|
75
|
-
'relay-connection-types': import("../types.js").GraphQLESLintRule<
|
75
|
+
'relay-connection-types': import("../types.js").GraphQLESLintRule<[], false>;
|
76
76
|
'relay-edge-types': import("../types.js").GraphQLESLintRule<{
|
77
|
-
withEdgeSuffix?: boolean;
|
78
|
-
shouldImplementNode?: boolean;
|
79
|
-
listTypeCanWrapOnlyEdgeType?: boolean;
|
77
|
+
withEdgeSuffix?: boolean | undefined;
|
78
|
+
shouldImplementNode?: boolean | undefined;
|
79
|
+
listTypeCanWrapOnlyEdgeType?: boolean | undefined;
|
80
80
|
}[], true>;
|
81
|
-
'relay-page-info': import("../types.js").GraphQLESLintRule<
|
81
|
+
'relay-page-info': import("../types.js").GraphQLESLintRule<[], false>;
|
82
82
|
'require-deprecation-date': import("../types.js").GraphQLESLintRule<{
|
83
|
-
argumentName?: string;
|
83
|
+
argumentName?: string | undefined;
|
84
84
|
}[], false>;
|
85
|
-
'require-deprecation-reason': import("../types.js").GraphQLESLintRule<
|
85
|
+
'require-deprecation-reason': import("../types.js").GraphQLESLintRule<[], false>;
|
86
86
|
'require-description': import("../types.js").GraphQLESLintRule<import("./require-description.js").RuleOptions, false>;
|
87
|
-
'require-field-of-type-query-in-mutation-result': import("../types.js").GraphQLESLintRule<
|
87
|
+
'require-field-of-type-query-in-mutation-result': import("../types.js").GraphQLESLintRule<[], false>;
|
88
88
|
'require-id-when-available': import("../types.js").GraphQLESLintRule<{
|
89
|
-
fieldName?: string | string[];
|
89
|
+
fieldName?: string | string[] | undefined;
|
90
90
|
}[], true>;
|
91
|
-
'require-nullable-fields-with-oneof': import("../types.js").GraphQLESLintRule<
|
92
|
-
'require-type-pattern-with-oneof': import("../types.js").GraphQLESLintRule<
|
91
|
+
'require-nullable-fields-with-oneof': import("../types.js").GraphQLESLintRule<[], false>;
|
92
|
+
'require-type-pattern-with-oneof': import("../types.js").GraphQLESLintRule<[], false>;
|
93
93
|
'selection-set-depth': import("../types.js").GraphQLESLintRule<{
|
94
|
-
ignore?: string[];
|
94
|
+
ignore?: string[] | undefined;
|
95
95
|
maxDepth: number;
|
96
96
|
}[], false>;
|
97
97
|
'strict-id-in-types': import("../types.js").GraphQLESLintRule<{
|
98
|
-
acceptedIdNames?: string[];
|
99
|
-
acceptedIdTypes?: string[];
|
98
|
+
acceptedIdNames?: string[] | undefined;
|
99
|
+
acceptedIdTypes?: string[] | undefined;
|
100
100
|
exceptions?: {
|
101
|
-
types?: string[];
|
102
|
-
suffixes?: string[];
|
103
|
-
};
|
101
|
+
types?: string[] | undefined;
|
102
|
+
suffixes?: string[] | undefined;
|
103
|
+
} | undefined;
|
104
104
|
}[], false>;
|
105
|
-
'unique-fragment-name': import("../types.js").GraphQLESLintRule<
|
106
|
-
'unique-operation-name': import("../types.js").GraphQLESLintRule<
|
105
|
+
'unique-fragment-name': import("../types.js").GraphQLESLintRule<[], false>;
|
106
|
+
'unique-operation-name': import("../types.js").GraphQLESLintRule<[], false>;
|
107
107
|
};
|
package/typings/rules/index.d.ts
CHANGED
@@ -1,107 +1,107 @@
|
|
1
1
|
export declare const rules: {
|
2
2
|
alphabetize: import("../types.js").GraphQLESLintRule<{
|
3
|
-
definitions?: boolean;
|
4
|
-
selections?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<"OperationDefinition" | "FragmentDefinition">[];
|
5
|
-
arguments?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<"Field" | "Directive" | "FieldDefinition" | "DirectiveDefinition">[];
|
6
|
-
values?: "EnumTypeDefinition"[];
|
7
|
-
fields?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<"ObjectTypeDefinition" | "InterfaceTypeDefinition" | "InputObjectTypeDefinition">[];
|
8
|
-
variables?: "OperationDefinition"[];
|
9
|
-
groups?: string[];
|
3
|
+
definitions?: boolean | undefined;
|
4
|
+
selections?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<"OperationDefinition" | "FragmentDefinition">[] | undefined;
|
5
|
+
arguments?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<"Field" | "Directive" | "FieldDefinition" | "DirectiveDefinition">[] | undefined;
|
6
|
+
values?: "EnumTypeDefinition"[] | undefined;
|
7
|
+
fields?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<"ObjectTypeDefinition" | "InterfaceTypeDefinition" | "InputObjectTypeDefinition">[] | undefined;
|
8
|
+
variables?: "OperationDefinition"[] | undefined;
|
9
|
+
groups?: string[] | undefined;
|
10
10
|
}[], false>;
|
11
11
|
'description-style': import("../types.js").GraphQLESLintRule<{
|
12
|
-
style?: "block" | "inline";
|
12
|
+
style?: "block" | "inline" | undefined;
|
13
13
|
}[], false>;
|
14
14
|
'input-name': import("../types.js").GraphQLESLintRule<{
|
15
|
-
checkInputType?: boolean;
|
16
|
-
caseSensitiveInputType?: boolean;
|
17
|
-
checkQueries?: boolean;
|
18
|
-
checkMutations?: boolean;
|
15
|
+
checkInputType?: boolean | undefined;
|
16
|
+
caseSensitiveInputType?: boolean | undefined;
|
17
|
+
checkQueries?: boolean | undefined;
|
18
|
+
checkMutations?: boolean | undefined;
|
19
19
|
}[], false>;
|
20
20
|
'lone-executable-definition': import("../types.js").GraphQLESLintRule<{
|
21
|
-
ignore?: ("fragment" | "query" | "mutation" | "subscription")[];
|
21
|
+
ignore?: ("fragment" | "query" | "mutation" | "subscription")[] | undefined;
|
22
22
|
}[], false>;
|
23
23
|
'match-document-filename': import("../types.js").GraphQLESLintRule<{
|
24
24
|
fragment?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<import("../utils.js").CaseStyle | "matchDocumentStyle"> | {
|
25
|
-
style?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<import("../utils.js").CaseStyle | "matchDocumentStyle"
|
26
|
-
suffix?: string;
|
27
|
-
prefix?: string;
|
28
|
-
};
|
25
|
+
style?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<import("../utils.js").CaseStyle | "matchDocumentStyle"> | undefined;
|
26
|
+
suffix?: string | undefined;
|
27
|
+
prefix?: string | undefined;
|
28
|
+
} | undefined;
|
29
29
|
query?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<import("../utils.js").CaseStyle | "matchDocumentStyle"> | {
|
30
|
-
style?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<import("../utils.js").CaseStyle | "matchDocumentStyle"
|
31
|
-
suffix?: string;
|
32
|
-
prefix?: string;
|
33
|
-
};
|
30
|
+
style?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<import("../utils.js").CaseStyle | "matchDocumentStyle"> | undefined;
|
31
|
+
suffix?: string | undefined;
|
32
|
+
prefix?: string | undefined;
|
33
|
+
} | undefined;
|
34
34
|
mutation?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<import("../utils.js").CaseStyle | "matchDocumentStyle"> | {
|
35
|
-
style?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<import("../utils.js").CaseStyle | "matchDocumentStyle"
|
36
|
-
suffix?: string;
|
37
|
-
prefix?: string;
|
38
|
-
};
|
35
|
+
style?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<import("../utils.js").CaseStyle | "matchDocumentStyle"> | undefined;
|
36
|
+
suffix?: string | undefined;
|
37
|
+
prefix?: string | undefined;
|
38
|
+
} | undefined;
|
39
39
|
subscription?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<import("../utils.js").CaseStyle | "matchDocumentStyle"> | {
|
40
|
-
style?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<import("../utils.js").CaseStyle | "matchDocumentStyle"
|
41
|
-
suffix?: string;
|
42
|
-
prefix?: string;
|
43
|
-
};
|
44
|
-
fileExtension?: ".gql" | ".graphql";
|
40
|
+
style?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<import("../utils.js").CaseStyle | "matchDocumentStyle"> | undefined;
|
41
|
+
suffix?: string | undefined;
|
42
|
+
prefix?: string | undefined;
|
43
|
+
} | undefined;
|
44
|
+
fileExtension?: ".gql" | ".graphql" | undefined;
|
45
45
|
}[], false>;
|
46
46
|
'naming-convention': import("../types.js").GraphQLESLintRule<{
|
47
47
|
[x: string]: unknown;
|
48
48
|
types?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<"camelCase" | "PascalCase" | "snake_case" | "UPPER_CASE"> | {
|
49
|
-
style?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<"camelCase" | "PascalCase" | "snake_case" | "UPPER_CASE"
|
50
|
-
suffix?: string;
|
51
|
-
prefix?: string;
|
52
|
-
forbiddenPrefixes?: string[];
|
53
|
-
forbiddenSuffixes?: string[];
|
54
|
-
ignorePattern?: string;
|
55
|
-
};
|
56
|
-
allowLeadingUnderscore?: boolean;
|
57
|
-
allowTrailingUnderscore?: boolean;
|
49
|
+
style?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<"camelCase" | "PascalCase" | "snake_case" | "UPPER_CASE"> | undefined;
|
50
|
+
suffix?: string | undefined;
|
51
|
+
prefix?: string | undefined;
|
52
|
+
forbiddenPrefixes?: string[] | undefined;
|
53
|
+
forbiddenSuffixes?: string[] | undefined;
|
54
|
+
ignorePattern?: string | undefined;
|
55
|
+
} | undefined;
|
56
|
+
allowLeadingUnderscore?: boolean | undefined;
|
57
|
+
allowTrailingUnderscore?: boolean | undefined;
|
58
58
|
}[], false>;
|
59
|
-
'no-anonymous-operations': import("../types.js").GraphQLESLintRule<
|
60
|
-
'no-case-insensitive-enum-values-duplicates': import("../types.js").GraphQLESLintRule<
|
59
|
+
'no-anonymous-operations': import("../types.js").GraphQLESLintRule<[], false>;
|
60
|
+
'no-case-insensitive-enum-values-duplicates': import("../types.js").GraphQLESLintRule<[], false>;
|
61
61
|
'no-deprecated': import("../types.js").GraphQLESLintRule<[], true>;
|
62
|
-
'no-duplicate-fields': import("../types.js").GraphQLESLintRule<
|
63
|
-
'no-hashtag-description': import("../types.js").GraphQLESLintRule<
|
64
|
-
'no-one-place-fragments': import("../types.js").GraphQLESLintRule<
|
62
|
+
'no-duplicate-fields': import("../types.js").GraphQLESLintRule<[], false>;
|
63
|
+
'no-hashtag-description': import("../types.js").GraphQLESLintRule<[], false>;
|
64
|
+
'no-one-place-fragments': import("../types.js").GraphQLESLintRule<[], false>;
|
65
65
|
'no-root-type': import("../types.js").GraphQLESLintRule<{
|
66
66
|
disallow: ("mutation" | "subscription")[];
|
67
67
|
}[], false>;
|
68
|
-
'no-scalar-result-type-on-mutation': import("../types.js").GraphQLESLintRule<
|
69
|
-
'no-typename-prefix': import("../types.js").GraphQLESLintRule<
|
70
|
-
'no-unreachable-types': import("../types.js").GraphQLESLintRule<
|
71
|
-
'no-unused-fields': import("../types.js").GraphQLESLintRule<
|
68
|
+
'no-scalar-result-type-on-mutation': import("../types.js").GraphQLESLintRule<[], false>;
|
69
|
+
'no-typename-prefix': import("../types.js").GraphQLESLintRule<[], false>;
|
70
|
+
'no-unreachable-types': import("../types.js").GraphQLESLintRule<[], false>;
|
71
|
+
'no-unused-fields': import("../types.js").GraphQLESLintRule<[], false>;
|
72
72
|
'relay-arguments': import("../types.js").GraphQLESLintRule<{
|
73
|
-
includeBoth?: boolean;
|
73
|
+
includeBoth?: boolean | undefined;
|
74
74
|
}[], true>;
|
75
|
-
'relay-connection-types': import("../types.js").GraphQLESLintRule<
|
75
|
+
'relay-connection-types': import("../types.js").GraphQLESLintRule<[], false>;
|
76
76
|
'relay-edge-types': import("../types.js").GraphQLESLintRule<{
|
77
|
-
withEdgeSuffix?: boolean;
|
78
|
-
shouldImplementNode?: boolean;
|
79
|
-
listTypeCanWrapOnlyEdgeType?: boolean;
|
77
|
+
withEdgeSuffix?: boolean | undefined;
|
78
|
+
shouldImplementNode?: boolean | undefined;
|
79
|
+
listTypeCanWrapOnlyEdgeType?: boolean | undefined;
|
80
80
|
}[], true>;
|
81
|
-
'relay-page-info': import("../types.js").GraphQLESLintRule<
|
81
|
+
'relay-page-info': import("../types.js").GraphQLESLintRule<[], false>;
|
82
82
|
'require-deprecation-date': import("../types.js").GraphQLESLintRule<{
|
83
|
-
argumentName?: string;
|
83
|
+
argumentName?: string | undefined;
|
84
84
|
}[], false>;
|
85
|
-
'require-deprecation-reason': import("../types.js").GraphQLESLintRule<
|
85
|
+
'require-deprecation-reason': import("../types.js").GraphQLESLintRule<[], false>;
|
86
86
|
'require-description': import("../types.js").GraphQLESLintRule<import("./require-description.js").RuleOptions, false>;
|
87
|
-
'require-field-of-type-query-in-mutation-result': import("../types.js").GraphQLESLintRule<
|
87
|
+
'require-field-of-type-query-in-mutation-result': import("../types.js").GraphQLESLintRule<[], false>;
|
88
88
|
'require-id-when-available': import("../types.js").GraphQLESLintRule<{
|
89
|
-
fieldName?: string | string[];
|
89
|
+
fieldName?: string | string[] | undefined;
|
90
90
|
}[], true>;
|
91
|
-
'require-nullable-fields-with-oneof': import("../types.js").GraphQLESLintRule<
|
92
|
-
'require-type-pattern-with-oneof': import("../types.js").GraphQLESLintRule<
|
91
|
+
'require-nullable-fields-with-oneof': import("../types.js").GraphQLESLintRule<[], false>;
|
92
|
+
'require-type-pattern-with-oneof': import("../types.js").GraphQLESLintRule<[], false>;
|
93
93
|
'selection-set-depth': import("../types.js").GraphQLESLintRule<{
|
94
|
-
ignore?: string[];
|
94
|
+
ignore?: string[] | undefined;
|
95
95
|
maxDepth: number;
|
96
96
|
}[], false>;
|
97
97
|
'strict-id-in-types': import("../types.js").GraphQLESLintRule<{
|
98
|
-
acceptedIdNames?: string[];
|
99
|
-
acceptedIdTypes?: string[];
|
98
|
+
acceptedIdNames?: string[] | undefined;
|
99
|
+
acceptedIdTypes?: string[] | undefined;
|
100
100
|
exceptions?: {
|
101
|
-
types?: string[];
|
102
|
-
suffixes?: string[];
|
103
|
-
};
|
101
|
+
types?: string[] | undefined;
|
102
|
+
suffixes?: string[] | undefined;
|
103
|
+
} | undefined;
|
104
104
|
}[], false>;
|
105
|
-
'unique-fragment-name': import("../types.js").GraphQLESLintRule<
|
106
|
-
'unique-operation-name': import("../types.js").GraphQLESLintRule<
|
105
|
+
'unique-fragment-name': import("../types.js").GraphQLESLintRule<[], false>;
|
106
|
+
'unique-operation-name': import("../types.js").GraphQLESLintRule<[], false>;
|
107
107
|
};
|
package/typings/testkit.d.cts
CHANGED
@@ -13,11 +13,12 @@ export type GraphQLInvalidTestCase<T> = GraphQLValidTestCase<T> & {
|
|
13
13
|
errors: number | (RuleTester.TestCaseError | string)[];
|
14
14
|
output?: string | null;
|
15
15
|
};
|
16
|
+
type RuleTesterConfig = {
|
17
|
+
parser: string;
|
18
|
+
parserOptions: Omit<ParserOptions, 'filePath'>;
|
19
|
+
};
|
16
20
|
export declare class GraphQLRuleTester extends RuleTester {
|
17
|
-
config:
|
18
|
-
parser: string;
|
19
|
-
parserOptions: Omit<ParserOptions, 'filePath'>;
|
20
|
-
};
|
21
|
+
config: RuleTesterConfig;
|
21
22
|
constructor(parserOptions?: Omit<ParserOptions, 'filePath'>);
|
22
23
|
fromMockFile(path: string): string;
|
23
24
|
runGraphQLTests<Options, WithTypeInfo extends boolean = false>(ruleId: string, rule: GraphQLESLintRule<Options, WithTypeInfo>, tests: {
|
@@ -25,3 +26,4 @@ export declare class GraphQLRuleTester extends RuleTester {
|
|
25
26
|
invalid: GraphQLInvalidTestCase<Options>[];
|
26
27
|
}): void;
|
27
28
|
}
|
29
|
+
export {};
|
package/typings/testkit.d.ts
CHANGED
@@ -13,11 +13,12 @@ export type GraphQLInvalidTestCase<T> = GraphQLValidTestCase<T> & {
|
|
13
13
|
errors: number | (RuleTester.TestCaseError | string)[];
|
14
14
|
output?: string | null;
|
15
15
|
};
|
16
|
+
type RuleTesterConfig = {
|
17
|
+
parser: string;
|
18
|
+
parserOptions: Omit<ParserOptions, 'filePath'>;
|
19
|
+
};
|
16
20
|
export declare class GraphQLRuleTester extends RuleTester {
|
17
|
-
config:
|
18
|
-
parser: string;
|
19
|
-
parserOptions: Omit<ParserOptions, 'filePath'>;
|
20
|
-
};
|
21
|
+
config: RuleTesterConfig;
|
21
22
|
constructor(parserOptions?: Omit<ParserOptions, 'filePath'>);
|
22
23
|
fromMockFile(path: string): string;
|
23
24
|
runGraphQLTests<Options, WithTypeInfo extends boolean = false>(ruleId: string, rule: GraphQLESLintRule<Options, WithTypeInfo>, tests: {
|
@@ -25,3 +26,4 @@ export declare class GraphQLRuleTester extends RuleTester {
|
|
25
26
|
invalid: GraphQLInvalidTestCase<Options>[];
|
26
27
|
}): void;
|
27
28
|
}
|
29
|
+
export {};
|
package/typings/types.d.cts
CHANGED
@@ -44,10 +44,11 @@ export type ReportDescriptor = Rule.ReportDescriptorMessage & Rule.ReportDescrip
|
|
44
44
|
export type GraphQLESLintRuleContext<Options = any[]> = Omit<Rule.RuleContext, 'parserServices' | 'report' | 'options'> & {
|
45
45
|
options: Options;
|
46
46
|
report(descriptor: ReportDescriptor): void;
|
47
|
-
parserServices
|
47
|
+
parserServices: ParserServices;
|
48
48
|
};
|
49
49
|
export type CategoryType = 'Schema' | 'Operations';
|
50
|
-
|
50
|
+
type RuleMetaDataDocs = Required<Rule.RuleMetaData>['docs'];
|
51
|
+
export type RuleDocsInfo<T> = Omit<RuleMetaDataDocs, 'category' | 'suggestion'> & {
|
51
52
|
category: CategoryType | CategoryType[];
|
52
53
|
requiresSchema?: true;
|
53
54
|
requiresSiblings?: true;
|
@@ -63,7 +64,7 @@ export type RuleDocsInfo<T> = Omit<Rule.RuleMetaData['docs'], 'category' | 'sugg
|
|
63
64
|
graphQLJSRuleName?: string;
|
64
65
|
isDisabledForAllConfig?: true;
|
65
66
|
};
|
66
|
-
export type GraphQLESLintRule<Options =
|
67
|
+
export type GraphQLESLintRule<Options = [], WithTypeInfo extends boolean = false> = {
|
67
68
|
create(context: GraphQLESLintRuleContext<Options>): GraphQLESLintRuleListener<WithTypeInfo>;
|
68
69
|
meta: Omit<Rule.RuleMetaData, 'docs' | 'schema'> & {
|
69
70
|
docs?: RuleDocsInfo<Options>;
|
package/typings/types.d.ts
CHANGED
@@ -44,10 +44,11 @@ export type ReportDescriptor = Rule.ReportDescriptorMessage & Rule.ReportDescrip
|
|
44
44
|
export type GraphQLESLintRuleContext<Options = any[]> = Omit<Rule.RuleContext, 'parserServices' | 'report' | 'options'> & {
|
45
45
|
options: Options;
|
46
46
|
report(descriptor: ReportDescriptor): void;
|
47
|
-
parserServices
|
47
|
+
parserServices: ParserServices;
|
48
48
|
};
|
49
49
|
export type CategoryType = 'Schema' | 'Operations';
|
50
|
-
|
50
|
+
type RuleMetaDataDocs = Required<Rule.RuleMetaData>['docs'];
|
51
|
+
export type RuleDocsInfo<T> = Omit<RuleMetaDataDocs, 'category' | 'suggestion'> & {
|
51
52
|
category: CategoryType | CategoryType[];
|
52
53
|
requiresSchema?: true;
|
53
54
|
requiresSiblings?: true;
|
@@ -63,7 +64,7 @@ export type RuleDocsInfo<T> = Omit<Rule.RuleMetaData['docs'], 'category' | 'sugg
|
|
63
64
|
graphQLJSRuleName?: string;
|
64
65
|
isDisabledForAllConfig?: true;
|
65
66
|
};
|
66
|
-
export type GraphQLESLintRule<Options =
|
67
|
+
export type GraphQLESLintRule<Options = [], WithTypeInfo extends boolean = false> = {
|
67
68
|
create(context: GraphQLESLintRuleContext<Options>): GraphQLESLintRuleListener<WithTypeInfo>;
|
68
69
|
meta: Omit<Rule.RuleMetaData, 'docs' | 'schema'> & {
|
69
70
|
docs?: RuleDocsInfo<Options>;
|
package/typings/utils.d.cts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { GraphQLSchema, Kind } from 'graphql';
|
1
|
+
import { ASTNode, GraphQLSchema, Kind } from 'graphql';
|
2
2
|
import { AST } from 'eslint';
|
3
3
|
import { Position } from 'estree';
|
4
4
|
import { GraphQLESLintRuleContext } from './types.cjs';
|
@@ -6,13 +6,13 @@ import { SiblingOperations } from './documents.cjs';
|
|
6
6
|
export declare function requireSiblingsOperations(ruleId: string, context: GraphQLESLintRuleContext): SiblingOperations | never;
|
7
7
|
export declare function requireGraphQLSchemaFromContext(ruleId: string, context: GraphQLESLintRuleContext): GraphQLSchema | never;
|
8
8
|
export declare const logger: {
|
9
|
-
error: (...args:
|
10
|
-
warn: (...args:
|
9
|
+
error: (...args: unknown[]) => void;
|
10
|
+
warn: (...args: unknown[]) => void;
|
11
11
|
};
|
12
12
|
export declare const normalizePath: (path: string) => string;
|
13
13
|
export declare const VIRTUAL_DOCUMENT_REGEX: RegExp;
|
14
14
|
export declare const CWD: string;
|
15
|
-
export declare const getTypeName: (node:
|
15
|
+
export declare const getTypeName: (node: ASTNode) => string;
|
16
16
|
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];
|
17
17
|
export type CaseStyle = 'camelCase' | 'PascalCase' | 'snake_case' | 'UPPER_CASE' | 'kebab-case';
|
18
18
|
export declare const pascalCase: (str: string) => string;
|
@@ -31,4 +31,7 @@ export declare const ARRAY_DEFAULT_OPTIONS: {
|
|
31
31
|
readonly type: "string";
|
32
32
|
};
|
33
33
|
};
|
34
|
-
export declare const englishJoinWords: (words:
|
34
|
+
export declare const englishJoinWords: (words: string[]) => string;
|
35
|
+
type Truthy<T> = T extends false | '' | 0 | null | undefined ? never : T;
|
36
|
+
export declare function truthy<T>(value: T): value is Truthy<T>;
|
37
|
+
export {};
|