@graphql-eslint/eslint-plugin 3.6.0-alpha-56305a5.0 → 3.7.1-alpha-d9a3c78.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/README.md +1 -1
- package/docs/parser.md +1 -1
- package/docs/rules/alphabetize.md +2 -0
- package/docs/rules/match-document-filename.md +2 -1
- package/docs/rules/require-description.md +18 -1
- package/estree-parser/estree-ast.d.ts +1 -2
- package/estree-parser/utils.d.ts +10 -5
- package/index.js +300 -193
- package/index.mjs +299 -192
- package/package.json +3 -3
- package/rules/alphabetize.d.ts +1 -1
- package/rules/index.d.ts +2 -21
- package/rules/match-document-filename.d.ts +2 -1
- package/rules/require-description.d.ts +2 -2
- package/testkit.d.ts +0 -1
- package/utils.d.ts +4 -8
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@graphql-eslint/eslint-plugin",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.7.1-alpha-d9a3c78.0",
|
4
4
|
"description": "GraphQL plugin for ESLint",
|
5
5
|
"sideEffects": false,
|
6
6
|
"peerDependencies": {
|
@@ -9,8 +9,8 @@
|
|
9
9
|
"dependencies": {
|
10
10
|
"@babel/code-frame": "7.16.7",
|
11
11
|
"@graphql-tools/code-file-loader": "7.2.3",
|
12
|
-
"@graphql-tools/graphql-tag-pluck": "7.1.
|
13
|
-
"@graphql-tools/utils": "8.
|
12
|
+
"@graphql-tools/graphql-tag-pluck": "7.1.5",
|
13
|
+
"@graphql-tools/utils": "8.6.1",
|
14
14
|
"chalk": "4.1.2",
|
15
15
|
"graphql-config": "4.1.0",
|
16
16
|
"graphql-depth-limit": "1.1.0",
|
package/rules/alphabetize.d.ts
CHANGED
@@ -4,7 +4,7 @@ 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 = {
|
7
|
+
export declare type AlphabetizeConfig = {
|
8
8
|
fields?: typeof fieldsEnum;
|
9
9
|
values?: typeof valuesEnum;
|
10
10
|
selections?: typeof selectionsEnum;
|
package/rules/index.d.ts
CHANGED
@@ -1,11 +1,5 @@
|
|
1
1
|
export declare const rules: {
|
2
|
-
alphabetize: import("..").GraphQLESLintRule<[
|
3
|
-
fields?: ("ObjectTypeDefinition" | "InterfaceTypeDefinition" | "InputObjectTypeDefinition")[];
|
4
|
-
values?: ["EnumTypeDefinition"];
|
5
|
-
selections?: ("OperationDefinition" | "FragmentDefinition")[];
|
6
|
-
variables?: ["OperationDefinition"];
|
7
|
-
arguments?: ("Field" | "Directive" | "FieldDefinition" | "DirectiveDefinition")[];
|
8
|
-
}], false>;
|
2
|
+
alphabetize: import("..").GraphQLESLintRule<[import("./alphabetize").AlphabetizeConfig], false>;
|
9
3
|
'description-style': import("..").GraphQLESLintRule<[{
|
10
4
|
style: "block" | "inline";
|
11
5
|
}], false>;
|
@@ -33,20 +27,7 @@ export declare const rules: {
|
|
33
27
|
argumentName?: string;
|
34
28
|
}], false>;
|
35
29
|
'require-deprecation-reason': import("..").GraphQLESLintRule<any[], false>;
|
36
|
-
'require-description': import("..").GraphQLESLintRule<[
|
37
|
-
types?: boolean;
|
38
|
-
} & {
|
39
|
-
ScalarTypeDefinition?: boolean;
|
40
|
-
ObjectTypeDefinition?: boolean;
|
41
|
-
FieldDefinition?: boolean;
|
42
|
-
InputValueDefinition?: boolean;
|
43
|
-
InterfaceTypeDefinition?: boolean;
|
44
|
-
UnionTypeDefinition?: boolean;
|
45
|
-
EnumTypeDefinition?: boolean;
|
46
|
-
EnumValueDefinition?: boolean;
|
47
|
-
InputObjectTypeDefinition?: boolean;
|
48
|
-
DirectiveDefinition?: boolean;
|
49
|
-
}], false>;
|
30
|
+
'require-description': import("..").GraphQLESLintRule<[import("./require-description").RequireDescriptionRuleConfig], false>;
|
50
31
|
'require-field-of-type-query-in-mutation-result': import("..").GraphQLESLintRule<any[], false>;
|
51
32
|
'require-id-when-available': import("..").GraphQLESLintRule<[import("./require-id-when-available").RequireIdWhenAvailableRuleConfig], true>;
|
52
33
|
'selection-set-depth': import("..").GraphQLESLintRule<[{
|
@@ -1,5 +1,6 @@
|
|
1
|
-
import { CaseStyle } from '../utils';
|
1
|
+
import { CaseStyle as _CaseStyle } from '../utils';
|
2
2
|
import { GraphQLESLintRule } from '../types';
|
3
|
+
declare type CaseStyle = _CaseStyle | 'matchDocumentStyle';
|
3
4
|
declare const ACCEPTED_EXTENSIONS: ['.gql', '.graphql'];
|
4
5
|
declare type PropertySchema = {
|
5
6
|
style?: CaseStyle;
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { Kind } from 'graphql';
|
2
2
|
import { GraphQLESLintRule } from '../types';
|
3
|
-
declare const ALLOWED_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, Kind.FIELD_DEFINITION, Kind.INPUT_VALUE_DEFINITION, Kind.ENUM_VALUE_DEFINITION, Kind.
|
3
|
+
declare const ALLOWED_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, Kind.DIRECTIVE_DEFINITION, Kind.FIELD_DEFINITION, Kind.INPUT_VALUE_DEFINITION, Kind.ENUM_VALUE_DEFINITION, Kind.OPERATION_DEFINITION];
|
4
4
|
declare type AllowedKind = typeof ALLOWED_KINDS[number];
|
5
|
-
declare type RequireDescriptionRuleConfig = {
|
5
|
+
export declare type RequireDescriptionRuleConfig = {
|
6
6
|
types?: boolean;
|
7
7
|
} & {
|
8
8
|
[key in AllowedKind]?: boolean;
|
package/testkit.d.ts
CHANGED
@@ -6,7 +6,6 @@ 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;
|
10
9
|
options?: Options;
|
11
10
|
parserOptions?: ParserOptions;
|
12
11
|
};
|
package/utils.d.ts
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
import { GraphQLSchema,
|
2
|
-
import { AST } from 'eslint';
|
1
|
+
import { GraphQLSchema, Kind } from 'graphql';
|
2
|
+
import type { AST } from 'eslint';
|
3
3
|
import { Source as LoaderSource } from '@graphql-tools/utils';
|
4
4
|
import { GraphQLESLintRuleContext } from './types';
|
5
5
|
import { SiblingOperations } from './sibling-operations';
|
6
|
-
import {
|
6
|
+
import { ReachableTypes, UsedFields } 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
9
|
export declare const logger: {
|
@@ -12,7 +12,6 @@ export declare const logger: {
|
|
12
12
|
};
|
13
13
|
export declare function requireReachableTypesFromContext(ruleName: string, context: GraphQLESLintRuleContext): ReachableTypes | never;
|
14
14
|
export declare function requireUsedFieldsFromContext(ruleName: string, context: GraphQLESLintRuleContext): UsedFields | never;
|
15
|
-
export declare function extractTokens(source: Source): AST.Token[];
|
16
15
|
export declare const normalizePath: (path: string) => string;
|
17
16
|
/**
|
18
17
|
* https://github.com/prettier/eslint-plugin-prettier/blob/76bd45ece6d56eb52f75db6b4a1efdd2efb56392/eslint-plugin-prettier.js#L71
|
@@ -27,7 +26,4 @@ export declare const TYPES_KINDS: readonly [Kind.OBJECT_TYPE_DEFINITION, Kind.IN
|
|
27
26
|
export declare type CaseStyle = 'camelCase' | 'PascalCase' | 'snake_case' | 'UPPER_CASE' | 'kebab-case';
|
28
27
|
export declare const camelCase: (str: string) => string;
|
29
28
|
export declare const convertCase: (style: CaseStyle, str: string) => string;
|
30
|
-
export declare function getLocation(loc: Partial<AST.SourceLocation>, fieldName?: string
|
31
|
-
offsetStart?: number;
|
32
|
-
offsetEnd?: number;
|
33
|
-
}): AST.SourceLocation;
|
29
|
+
export declare function getLocation(loc: Partial<AST.SourceLocation>, fieldName?: string): AST.SourceLocation;
|