@graphql-eslint/eslint-plugin 2.3.0-alpha-6ba4002.0 → 2.3.2-alpha-99be3d2.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 +1 -1
- package/configs/all.d.ts +7 -0
- package/configs/index.d.ts +7 -0
- package/docs/README.md +2 -1
- package/docs/custom-rules.md +3 -3
- package/docs/rules/alphabetize.md +145 -0
- package/docs/rules/avoid-duplicate-fields.md +6 -1
- package/docs/rules/avoid-operation-name-prefix.md +8 -8
- package/docs/rules/avoid-scalar-result-type-on-mutation.md +6 -1
- package/docs/rules/avoid-typename-prefix.md +6 -1
- package/docs/rules/description-style.md +10 -9
- package/docs/rules/executable-definitions.md +6 -1
- package/docs/rules/fields-on-correct-type.md +6 -1
- package/docs/rules/fragments-on-composite-type.md +6 -1
- package/docs/rules/input-name.md +11 -10
- package/docs/rules/known-argument-names.md +6 -1
- package/docs/rules/known-directives.md +6 -1
- package/docs/rules/known-fragment-names.md +6 -1
- package/docs/rules/known-type-names.md +6 -1
- package/docs/rules/lone-anonymous-operation.md +6 -1
- package/docs/rules/lone-schema-definition.md +6 -1
- package/docs/rules/match-document-filename.md +12 -11
- package/docs/rules/naming-convention.md +21 -20
- package/docs/rules/no-anonymous-operations.md +6 -1
- package/docs/rules/no-case-insensitive-enum-values-duplicates.md +5 -1
- package/docs/rules/no-deprecated.md +6 -1
- package/docs/rules/no-fragment-cycles.md +6 -1
- package/docs/rules/no-hashtag-description.md +6 -1
- package/docs/rules/no-operation-name-suffix.md +5 -1
- package/docs/rules/no-undefined-variables.md +6 -1
- package/docs/rules/no-unreachable-types.md +6 -1
- package/docs/rules/no-unused-fields.md +6 -1
- package/docs/rules/no-unused-fragments.md +6 -1
- package/docs/rules/no-unused-variables.md +6 -1
- package/docs/rules/one-field-subscriptions.md +6 -1
- package/docs/rules/overlapping-fields-can-be-merged.md +6 -1
- package/docs/rules/possible-fragment-spread.md +6 -1
- package/docs/rules/possible-type-extension.md +6 -1
- package/docs/rules/provided-required-arguments.md +6 -1
- package/docs/rules/require-deprecation-date.md +5 -4
- package/docs/rules/require-deprecation-reason.md +6 -1
- package/docs/rules/require-description.md +5 -8
- package/docs/rules/require-field-of-type-query-in-mutation-result.md +6 -1
- package/docs/rules/require-id-when-available.md +6 -5
- package/docs/rules/scalar-leafs.md +6 -1
- package/docs/rules/selection-set-depth.md +6 -9
- package/docs/rules/strict-id-in-types.md +12 -11
- package/docs/rules/unique-argument-names.md +6 -1
- package/docs/rules/unique-directive-names-per-location.md +6 -1
- package/docs/rules/unique-directive-names.md +6 -1
- package/docs/rules/unique-enum-value-names.md +6 -1
- package/docs/rules/unique-field-definition-names.md +6 -1
- package/docs/rules/unique-fragment-name.md +6 -1
- package/docs/rules/unique-input-field-names.md +6 -1
- package/docs/rules/unique-operation-name.md +6 -1
- package/docs/rules/unique-operation-types.md +6 -1
- package/docs/rules/unique-type-names.md +6 -1
- package/docs/rules/unique-variable-names.md +6 -1
- package/docs/rules/value-literals-of-correct-type.md +6 -1
- package/docs/rules/variables-are-input-types.md +6 -1
- package/docs/rules/variables-in-allowed-position.md +6 -1
- package/estree-parser/estree-ast.d.ts +2 -2
- package/index.js +466 -102
- package/index.mjs +466 -102
- package/package.json +1 -1
- package/rules/alphabetize.d.ts +17 -0
- package/rules/index.d.ts +7 -0
- package/testkit.d.ts +6 -4
- package/types.d.ts +3 -0
- package/utils.d.ts +4 -0
@@ -9,4 +9,9 @@
|
|
9
9
|
|
10
10
|
A GraphQL document is only valid if all value literals are of the type expected at their position.
|
11
11
|
|
12
|
-
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/ValuesOfCorrectTypeRule.ts).
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/ValuesOfCorrectTypeRule.ts).
|
13
|
+
|
14
|
+
## Resources
|
15
|
+
|
16
|
+
- [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/ValuesOfCorrectTypeRule.ts)
|
17
|
+
- [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/ValuesOfCorrectTypeRule-test.ts)
|
@@ -9,4 +9,9 @@
|
|
9
9
|
|
10
10
|
A GraphQL operation is only valid if all the variables it defines are of input types (scalar, enum, or input object).
|
11
11
|
|
12
|
-
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/VariablesAreInputTypesRule.ts).
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/VariablesAreInputTypesRule.ts).
|
13
|
+
|
14
|
+
## Resources
|
15
|
+
|
16
|
+
- [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/VariablesAreInputTypesRule.ts)
|
17
|
+
- [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/VariablesAreInputTypesRule-test.ts)
|
@@ -9,4 +9,9 @@
|
|
9
9
|
|
10
10
|
Variables passed to field arguments conform to type.
|
11
11
|
|
12
|
-
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/VariablesInAllowedPositionRule.ts).
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/VariablesInAllowedPositionRule.ts).
|
13
|
+
|
14
|
+
## Resources
|
15
|
+
|
16
|
+
- [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/VariablesInAllowedPositionRule.ts)
|
17
|
+
- [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/VariablesInAllowedPositionRule-test.ts)
|
@@ -5,7 +5,7 @@ export declare type SafeGraphQLType<T extends ASTNode | ValueNode> = Omit<T exte
|
|
5
5
|
} ? Omit<T, 'type'> & {
|
6
6
|
readonly gqlType: TypeNode;
|
7
7
|
} : T, 'loc'>;
|
8
|
-
export declare type SingleESTreeNode<T
|
8
|
+
export declare type SingleESTreeNode<T, WithTypeInfo extends boolean> = T extends ASTNode | ValueNode ? SafeGraphQLType<T> & Pick<BaseNode, 'leadingComments' | 'loc' | 'range'> & {
|
9
9
|
type: T['kind'];
|
10
10
|
gqlLocation: Location;
|
11
11
|
} & (WithTypeInfo extends true ? {
|
@@ -21,7 +21,7 @@ export declare type SingleESTreeNode<T extends any, WithTypeInfo extends boolean
|
|
21
21
|
gqlType?: ReturnType<TypeInfo['getType']>;
|
22
22
|
};
|
23
23
|
} : {}) : T;
|
24
|
-
export declare type GraphQLESTreeNode<T
|
24
|
+
export declare type GraphQLESTreeNode<T, WithTypeInfo extends boolean = false> = T extends ASTNode | ValueNode ? {
|
25
25
|
rawNode: () => T;
|
26
26
|
} & {
|
27
27
|
[K in keyof SingleESTreeNode<T, WithTypeInfo>]: SingleESTreeNode<T, WithTypeInfo>[K] extends ReadonlyArray<infer Nested> ? GraphQLESTreeNode<Nested, WithTypeInfo>[] : SingleESTreeNode<T, WithTypeInfo>[K] extends ASTNode ? GraphQLESTreeNode<SingleESTreeNode<T, WithTypeInfo>[K], WithTypeInfo> : SingleESTreeNode<T, WithTypeInfo>[K];
|