@graphql-eslint/eslint-plugin 3.0.0-alpha-580615a.0 → 3.0.0-alpha-7462f3d.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/configs/all.d.ts +3 -5
- package/configs/index.d.ts +4 -7
- package/configs/recommended.d.ts +1 -2
- package/docs/README.md +3 -5
- package/docs/deprecated-rules.md +21 -0
- package/docs/rules/{avoid-duplicate-fields.md → no-duplicate-fields.md} +7 -7
- package/docs/rules/no-root-type.md +6 -0
- package/docs/rules/{avoid-scalar-result-type-on-mutation.md → no-scalar-result-type-on-mutation.md} +6 -6
- package/docs/rules/{avoid-typename-prefix.md → no-typename-prefix.md} +6 -6
- package/index.js +298 -457
- package/index.mjs +299 -458
- package/package.json +1 -1
- package/rules/index.d.ts +3 -5
- package/rules/{avoid-duplicate-fields.d.ts → no-duplicate-fields.d.ts} +0 -0
- package/rules/{avoid-scalar-result-type-on-mutation.d.ts → no-scalar-result-type-on-mutation.d.ts} +0 -0
- package/rules/{avoid-typename-prefix.d.ts → no-typename-prefix.d.ts} +0 -0
- package/docs/rules/avoid-operation-name-prefix.md +0 -50
- package/docs/rules/no-operation-name-suffix.md +0 -38
- package/rules/avoid-operation-name-prefix.d.ts +0 -9
- package/rules/no-operation-name-suffix.d.ts +0 -3
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@graphql-eslint/eslint-plugin",
|
3
|
-
"version": "3.0.0-alpha-
|
3
|
+
"version": "3.0.0-alpha-7462f3d.0",
|
4
4
|
"sideEffects": false,
|
5
5
|
"peerDependencies": {
|
6
6
|
"graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
|
package/rules/index.d.ts
CHANGED
@@ -6,10 +6,6 @@ export declare const rules: {
|
|
6
6
|
variables?: ["OperationDefinition"];
|
7
7
|
arguments?: ("Field" | "Directive" | "FieldDefinition" | "DirectiveDefinition")[];
|
8
8
|
}], false>;
|
9
|
-
'avoid-duplicate-fields': import("..").GraphQLESLintRule<any[], false>;
|
10
|
-
'avoid-operation-name-prefix': import("..").GraphQLESLintRule<import("./avoid-operation-name-prefix").AvoidOperationNamePrefixConfig, false>;
|
11
|
-
'avoid-scalar-result-type-on-mutation': import("..").GraphQLESLintRule<any[], false>;
|
12
|
-
'avoid-typename-prefix': import("..").GraphQLESLintRule<any[], false>;
|
13
9
|
'description-style': import("..").GraphQLESLintRule<[{
|
14
10
|
style: "block" | "inline";
|
15
11
|
}], false>;
|
@@ -159,11 +155,13 @@ export declare const rules: {
|
|
159
155
|
'no-anonymous-operations': import("..").GraphQLESLintRule<any[], false>;
|
160
156
|
'no-case-insensitive-enum-values-duplicates': import("..").GraphQLESLintRule<any[], false>;
|
161
157
|
'no-deprecated': import("..").GraphQLESLintRule<[], true>;
|
158
|
+
'no-duplicate-fields': import("..").GraphQLESLintRule<any[], false>;
|
162
159
|
'no-hashtag-description': import("..").GraphQLESLintRule<any[], false>;
|
163
|
-
'no-operation-name-suffix': import("..").GraphQLESLintRule<any[], false>;
|
164
160
|
'no-root-type': import("..").GraphQLESLintRule<[{
|
165
161
|
disallow: ("query" | "mutation" | "subscription")[];
|
166
162
|
}], false>;
|
163
|
+
'no-scalar-result-type-on-mutation': import("..").GraphQLESLintRule<any[], false>;
|
164
|
+
'no-typename-prefix': import("..").GraphQLESLintRule<any[], false>;
|
167
165
|
'no-unreachable-types': import("..").GraphQLESLintRule<any[], false>;
|
168
166
|
'no-unused-fields': import("..").GraphQLESLintRule<any[], false>;
|
169
167
|
'require-deprecation-date': import("..").GraphQLESLintRule<[{
|
File without changes
|
package/rules/{avoid-scalar-result-type-on-mutation.d.ts → no-scalar-result-type-on-mutation.d.ts}
RENAMED
File without changes
|
File without changes
|
@@ -1,50 +0,0 @@
|
|
1
|
-
# `avoid-operation-name-prefix`
|
2
|
-
|
3
|
-
- Category: `Stylistic Issues`
|
4
|
-
- Rule name: `@graphql-eslint/avoid-operation-name-prefix`
|
5
|
-
- Requires GraphQL Schema: `false` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
|
6
|
-
- Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
|
7
|
-
|
8
|
-
Enforce/avoid operation name prefix, useful if you wish to avoid prefix in your root fields, or avoid using REST terminology in your schema.
|
9
|
-
|
10
|
-
## Usage Examples
|
11
|
-
|
12
|
-
### Incorrect
|
13
|
-
|
14
|
-
```graphql
|
15
|
-
# eslint @graphql-eslint/avoid-operation-name-prefix: ['error', { keywords: ['get'] }]
|
16
|
-
|
17
|
-
query getUserDetails {
|
18
|
-
# ...
|
19
|
-
}
|
20
|
-
```
|
21
|
-
|
22
|
-
### Correct
|
23
|
-
|
24
|
-
```graphql
|
25
|
-
# eslint @graphql-eslint/avoid-operation-name-prefix: ['error', { keywords: ['get'] }]
|
26
|
-
|
27
|
-
query userDetails {
|
28
|
-
# ...
|
29
|
-
}
|
30
|
-
```
|
31
|
-
|
32
|
-
## Config Schema
|
33
|
-
|
34
|
-
The schema defines the following properties:
|
35
|
-
|
36
|
-
### `caseSensitive` (boolean)
|
37
|
-
|
38
|
-
Default: `false`
|
39
|
-
|
40
|
-
### `keywords` (array, required)
|
41
|
-
|
42
|
-
The object is an array with all elements of the type `string`.
|
43
|
-
|
44
|
-
Additional restrictions:
|
45
|
-
|
46
|
-
* Minimum items: `1`
|
47
|
-
|
48
|
-
## Resources
|
49
|
-
|
50
|
-
- [Rule source](../../packages/plugin/src/rules/avoid-operation-name-prefix.ts)
|
@@ -1,38 +0,0 @@
|
|
1
|
-
# `no-operation-name-suffix`
|
2
|
-
|
3
|
-
✅ The `"extends": "plugin:@graphql-eslint/recommended"` property in a configuration file enables this rule.
|
4
|
-
|
5
|
-
🔧 The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#--fix) can automatically fix some of the problems reported by this rule.
|
6
|
-
|
7
|
-
- Category: `Stylistic Issues`
|
8
|
-
- Rule name: `@graphql-eslint/no-operation-name-suffix`
|
9
|
-
- Requires GraphQL Schema: `false` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
|
10
|
-
- Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
|
11
|
-
|
12
|
-
Makes sure you are not adding the operation type to the name of the operation.
|
13
|
-
|
14
|
-
## Usage Examples
|
15
|
-
|
16
|
-
### Incorrect
|
17
|
-
|
18
|
-
```graphql
|
19
|
-
# eslint @graphql-eslint/no-operation-name-suffix: 'error'
|
20
|
-
|
21
|
-
query userQuery {
|
22
|
-
# ...
|
23
|
-
}
|
24
|
-
```
|
25
|
-
|
26
|
-
### Correct
|
27
|
-
|
28
|
-
```graphql
|
29
|
-
# eslint @graphql-eslint/no-operation-name-suffix: 'error'
|
30
|
-
|
31
|
-
query user {
|
32
|
-
# ...
|
33
|
-
}
|
34
|
-
```
|
35
|
-
|
36
|
-
## Resources
|
37
|
-
|
38
|
-
- [Rule source](../../packages/plugin/src/rules/no-operation-name-suffix.ts)
|