@graphql-eslint/eslint-plugin 3.13.1-alpha-20221103065216-8fcfb42 → 3.13.1-alpha-20221103130705-abbda8b
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +21 -0
- package/package.json +2 -2
- package/README.md +0 -266
- package/docs/README.md +0 -76
- package/docs/custom-rules.md +0 -148
- package/docs/deprecated-rules.md +0 -21
- package/docs/parser-options.md +0 -85
- package/docs/parser.md +0 -49
- package/docs/rules/alphabetize.md +0 -178
- package/docs/rules/description-style.md +0 -54
- package/docs/rules/executable-definitions.md +0 -17
- package/docs/rules/fields-on-correct-type.md +0 -17
- package/docs/rules/fragments-on-composite-type.md +0 -17
- package/docs/rules/input-name.md +0 -76
- package/docs/rules/known-argument-names.md +0 -17
- package/docs/rules/known-directives.md +0 -44
- package/docs/rules/known-fragment-names.md +0 -69
- package/docs/rules/known-type-names.md +0 -17
- package/docs/rules/lone-anonymous-operation.md +0 -17
- package/docs/rules/lone-schema-definition.md +0 -17
- package/docs/rules/match-document-filename.md +0 -156
- package/docs/rules/naming-convention.md +0 -300
- package/docs/rules/no-anonymous-operations.md +0 -39
- package/docs/rules/no-case-insensitive-enum-values-duplicates.md +0 -43
- package/docs/rules/no-deprecated.md +0 -85
- package/docs/rules/no-duplicate-fields.md +0 -65
- package/docs/rules/no-fragment-cycles.md +0 -17
- package/docs/rules/no-hashtag-description.md +0 -59
- package/docs/rules/no-root-type.md +0 -53
- package/docs/rules/no-scalar-result-type-on-mutation.md +0 -37
- package/docs/rules/no-typename-prefix.md +0 -39
- package/docs/rules/no-undefined-variables.md +0 -17
- package/docs/rules/no-unreachable-types.md +0 -49
- package/docs/rules/no-unused-fields.md +0 -62
- package/docs/rules/no-unused-fragments.md +0 -17
- package/docs/rules/no-unused-variables.md +0 -17
- package/docs/rules/one-field-subscriptions.md +0 -17
- package/docs/rules/overlapping-fields-can-be-merged.md +0 -17
- package/docs/rules/possible-fragment-spread.md +0 -17
- package/docs/rules/possible-type-extension.md +0 -15
- package/docs/rules/provided-required-arguments.md +0 -17
- package/docs/rules/relay-arguments.md +0 -57
- package/docs/rules/relay-connection-types.md +0 -42
- package/docs/rules/relay-edge-types.md +0 -56
- package/docs/rules/relay-page-info.md +0 -32
- package/docs/rules/require-deprecation-date.md +0 -57
- package/docs/rules/require-deprecation-reason.md +0 -47
- package/docs/rules/require-description.md +0 -115
- package/docs/rules/require-field-of-type-query-in-mutation-result.md +0 -47
- package/docs/rules/require-id-when-available.md +0 -88
- package/docs/rules/scalar-leafs.md +0 -17
- package/docs/rules/selection-set-depth.md +0 -76
- package/docs/rules/strict-id-in-types.md +0 -130
- package/docs/rules/unique-argument-names.md +0 -17
- package/docs/rules/unique-directive-names-per-location.md +0 -17
- package/docs/rules/unique-directive-names.md +0 -17
- package/docs/rules/unique-enum-value-names.md +0 -15
- package/docs/rules/unique-field-definition-names.md +0 -17
- package/docs/rules/unique-fragment-name.md +0 -51
- package/docs/rules/unique-input-field-names.md +0 -17
- package/docs/rules/unique-operation-name.md +0 -55
- package/docs/rules/unique-operation-types.md +0 -17
- package/docs/rules/unique-type-names.md +0 -17
- package/docs/rules/unique-variable-names.md +0 -17
- package/docs/rules/value-literals-of-correct-type.md +0 -17
- package/docs/rules/variables-are-input-types.md +0 -17
- package/docs/rules/variables-in-allowed-position.md +0 -17
@@ -1,51 +0,0 @@
|
|
1
|
-
# `unique-fragment-name`
|
2
|
-
|
3
|
-
- Category: `Operations`
|
4
|
-
- Rule name: `@graphql-eslint/unique-fragment-name`
|
5
|
-
- Requires GraphQL Schema: `false` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
|
6
|
-
- Requires GraphQL Operations: `true` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
|
7
|
-
|
8
|
-
Enforce unique fragment names across your project.
|
9
|
-
|
10
|
-
## Usage Examples
|
11
|
-
|
12
|
-
### Incorrect
|
13
|
-
|
14
|
-
```graphql
|
15
|
-
# eslint @graphql-eslint/unique-fragment-name: 'error'
|
16
|
-
|
17
|
-
# user.fragment.graphql
|
18
|
-
fragment UserFields on User {
|
19
|
-
id
|
20
|
-
name
|
21
|
-
fullName
|
22
|
-
}
|
23
|
-
|
24
|
-
# user-fields.graphql
|
25
|
-
fragment UserFields on User {
|
26
|
-
id
|
27
|
-
}
|
28
|
-
```
|
29
|
-
|
30
|
-
### Correct
|
31
|
-
|
32
|
-
```graphql
|
33
|
-
# eslint @graphql-eslint/unique-fragment-name: 'error'
|
34
|
-
|
35
|
-
# user.fragment.graphql
|
36
|
-
fragment AllUserFields on User {
|
37
|
-
id
|
38
|
-
name
|
39
|
-
fullName
|
40
|
-
}
|
41
|
-
|
42
|
-
# user-fields.graphql
|
43
|
-
fragment UserFields on User {
|
44
|
-
id
|
45
|
-
}
|
46
|
-
```
|
47
|
-
|
48
|
-
## Resources
|
49
|
-
|
50
|
-
- [Rule source](../../packages/plugin/src/rules/unique-fragment-name.ts)
|
51
|
-
- [Test source](../../packages/plugin/tests/unique-fragment-name.spec.ts)
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# `unique-input-field-names`
|
2
|
-
|
3
|
-
✅ The `"extends": "plugin:@graphql-eslint/operations-recommended"` property in a configuration file enables this rule.
|
4
|
-
|
5
|
-
- Category: `Operations`
|
6
|
-
- Rule name: `@graphql-eslint/unique-input-field-names`
|
7
|
-
- Requires GraphQL Schema: `false` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
|
8
|
-
- Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
|
9
|
-
|
10
|
-
A GraphQL input object value is only valid if all supplied fields are uniquely named.
|
11
|
-
|
12
|
-
> This rule is a wrapper around a `graphql-js` validation function.
|
13
|
-
|
14
|
-
## Resources
|
15
|
-
|
16
|
-
- [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/UniqueInputFieldNamesRule.ts)
|
17
|
-
- [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/UniqueInputFieldNamesRule-test.ts)
|
@@ -1,55 +0,0 @@
|
|
1
|
-
# `unique-operation-name`
|
2
|
-
|
3
|
-
- Category: `Operations`
|
4
|
-
- Rule name: `@graphql-eslint/unique-operation-name`
|
5
|
-
- Requires GraphQL Schema: `false` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
|
6
|
-
- Requires GraphQL Operations: `true` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
|
7
|
-
|
8
|
-
Enforce unique operation names across your project.
|
9
|
-
|
10
|
-
## Usage Examples
|
11
|
-
|
12
|
-
### Incorrect
|
13
|
-
|
14
|
-
```graphql
|
15
|
-
# eslint @graphql-eslint/unique-operation-name: 'error'
|
16
|
-
|
17
|
-
# foo.query.graphql
|
18
|
-
query user {
|
19
|
-
user {
|
20
|
-
id
|
21
|
-
}
|
22
|
-
}
|
23
|
-
|
24
|
-
# bar.query.graphql
|
25
|
-
query user {
|
26
|
-
me {
|
27
|
-
id
|
28
|
-
}
|
29
|
-
}
|
30
|
-
```
|
31
|
-
|
32
|
-
### Correct
|
33
|
-
|
34
|
-
```graphql
|
35
|
-
# eslint @graphql-eslint/unique-operation-name: 'error'
|
36
|
-
|
37
|
-
# foo.query.graphql
|
38
|
-
query user {
|
39
|
-
user {
|
40
|
-
id
|
41
|
-
}
|
42
|
-
}
|
43
|
-
|
44
|
-
# bar.query.graphql
|
45
|
-
query me {
|
46
|
-
me {
|
47
|
-
id
|
48
|
-
}
|
49
|
-
}
|
50
|
-
```
|
51
|
-
|
52
|
-
## Resources
|
53
|
-
|
54
|
-
- [Rule source](../../packages/plugin/src/rules/unique-operation-name.ts)
|
55
|
-
- [Test source](../../packages/plugin/tests/unique-operation-name.spec.ts)
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# `unique-operation-types`
|
2
|
-
|
3
|
-
✅ The `"extends": "plugin:@graphql-eslint/schema-recommended"` property in a configuration file enables this rule.
|
4
|
-
|
5
|
-
- Category: `Schema`
|
6
|
-
- Rule name: `@graphql-eslint/unique-operation-types`
|
7
|
-
- Requires GraphQL Schema: `false` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
|
8
|
-
- Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
|
9
|
-
|
10
|
-
A GraphQL document is only valid if it has only one type per operation.
|
11
|
-
|
12
|
-
> This rule is a wrapper around a `graphql-js` validation function.
|
13
|
-
|
14
|
-
## Resources
|
15
|
-
|
16
|
-
- [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/UniqueOperationTypesRule.ts)
|
17
|
-
- [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/UniqueOperationTypesRule-test.ts)
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# `unique-type-names`
|
2
|
-
|
3
|
-
✅ The `"extends": "plugin:@graphql-eslint/schema-recommended"` property in a configuration file enables this rule.
|
4
|
-
|
5
|
-
- Category: `Schema`
|
6
|
-
- Rule name: `@graphql-eslint/unique-type-names`
|
7
|
-
- Requires GraphQL Schema: `false` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
|
8
|
-
- Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
|
9
|
-
|
10
|
-
A GraphQL document is only valid if all defined types have unique names.
|
11
|
-
|
12
|
-
> This rule is a wrapper around a `graphql-js` validation function.
|
13
|
-
|
14
|
-
## Resources
|
15
|
-
|
16
|
-
- [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/UniqueTypeNamesRule.ts)
|
17
|
-
- [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/UniqueTypeNamesRule-test.ts)
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# `unique-variable-names`
|
2
|
-
|
3
|
-
✅ The `"extends": "plugin:@graphql-eslint/operations-recommended"` property in a configuration file enables this rule.
|
4
|
-
|
5
|
-
- Category: `Operations`
|
6
|
-
- Rule name: `@graphql-eslint/unique-variable-names`
|
7
|
-
- Requires GraphQL Schema: `true` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
|
8
|
-
- Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
|
9
|
-
|
10
|
-
A GraphQL operation is only valid if all its variables are uniquely named.
|
11
|
-
|
12
|
-
> This rule is a wrapper around a `graphql-js` validation function.
|
13
|
-
|
14
|
-
## Resources
|
15
|
-
|
16
|
-
- [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/UniqueVariableNamesRule.ts)
|
17
|
-
- [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/UniqueVariableNamesRule-test.ts)
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# `value-literals-of-correct-type`
|
2
|
-
|
3
|
-
✅ The `"extends": "plugin:@graphql-eslint/operations-recommended"` property in a configuration file enables this rule.
|
4
|
-
|
5
|
-
- Category: `Operations`
|
6
|
-
- Rule name: `@graphql-eslint/value-literals-of-correct-type`
|
7
|
-
- Requires GraphQL Schema: `true` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
|
8
|
-
- Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
|
9
|
-
|
10
|
-
A GraphQL document is only valid if all value literals are of the type expected at their position.
|
11
|
-
|
12
|
-
> This rule is a wrapper around a `graphql-js` validation function.
|
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)
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# `variables-are-input-types`
|
2
|
-
|
3
|
-
✅ The `"extends": "plugin:@graphql-eslint/operations-recommended"` property in a configuration file enables this rule.
|
4
|
-
|
5
|
-
- Category: `Operations`
|
6
|
-
- Rule name: `@graphql-eslint/variables-are-input-types`
|
7
|
-
- Requires GraphQL Schema: `true` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
|
8
|
-
- Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
|
9
|
-
|
10
|
-
A GraphQL operation is only valid if all the variables it defines are of input types (scalar, enum, or input object).
|
11
|
-
|
12
|
-
> This rule is a wrapper around a `graphql-js` validation function.
|
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)
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# `variables-in-allowed-position`
|
2
|
-
|
3
|
-
✅ The `"extends": "plugin:@graphql-eslint/operations-recommended"` property in a configuration file enables this rule.
|
4
|
-
|
5
|
-
- Category: `Operations`
|
6
|
-
- Rule name: `@graphql-eslint/variables-in-allowed-position`
|
7
|
-
- Requires GraphQL Schema: `true` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
|
8
|
-
- Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
|
9
|
-
|
10
|
-
Variables passed to field arguments conform to type.
|
11
|
-
|
12
|
-
> This rule is a wrapper around a `graphql-js` validation function.
|
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)
|