@graphql-eslint/eslint-plugin 3.14.0 → 3.14.1-alpha-20221227103351-5f80ba8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. package/cjs/configs/base.js +0 -6
  2. package/cjs/configs/operations-all.js +1 -1
  3. package/cjs/configs/operations-recommended.js +2 -1
  4. package/cjs/configs/relay.js +2 -1
  5. package/cjs/configs/schema-all.js +1 -1
  6. package/cjs/configs/schema-recommended.js +2 -1
  7. package/cjs/rules/lone-executable-definition.js +1 -1
  8. package/cjs/rules/no-one-place-fragments.js +3 -3
  9. package/cjs/rules/require-nullable-fields-with-oneof.js +1 -1
  10. package/docs/README.md +2 -2
  11. package/docs/rules/lone-executable-definition.md +1 -1
  12. package/docs/rules/no-one-place-fragments.md +3 -3
  13. package/docs/rules/require-nullable-fields-with-oneof.md +1 -1
  14. package/esm/configs/operations-all.js +1 -1
  15. package/esm/configs/operations-recommended.js +2 -1
  16. package/esm/configs/relay.js +2 -1
  17. package/esm/configs/schema-all.js +1 -1
  18. package/esm/configs/schema-recommended.js +2 -1
  19. package/esm/rules/lone-executable-definition.js +1 -1
  20. package/esm/rules/no-one-place-fragments.js +3 -3
  21. package/esm/rules/require-nullable-fields-with-oneof.js +1 -1
  22. package/package.json +3 -2
  23. package/typings/configs/index.d.cts +8 -5
  24. package/typings/configs/index.d.ts +8 -5
  25. package/typings/configs/operations-all.d.cts +1 -1
  26. package/typings/configs/operations-all.d.ts +1 -1
  27. package/typings/configs/operations-recommended.d.cts +2 -1
  28. package/typings/configs/operations-recommended.d.ts +2 -1
  29. package/typings/configs/relay.d.cts +2 -1
  30. package/typings/configs/relay.d.ts +2 -1
  31. package/typings/configs/schema-all.d.cts +1 -1
  32. package/typings/configs/schema-all.d.ts +1 -1
  33. package/typings/configs/schema-recommended.d.cts +2 -1
  34. package/typings/configs/schema-recommended.d.ts +2 -1
  35. package/esm/configs/base.js +0 -4
  36. package/typings/configs/base.d.cts +0 -5
  37. package/typings/configs/base.d.ts +0 -5
@@ -1,7 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = {
4
- parser: '@graphql-eslint/eslint-plugin',
5
- plugins: ['@graphql-eslint'],
6
- };
7
1
  module.exports = exports.default;
@@ -4,7 +4,7 @@
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.default = {
7
- extends: ['./configs/base', './configs/operations-recommended'],
7
+ extends: './configs/operations-recommended',
8
8
  rules: {
9
9
  '@graphql-eslint/alphabetize': [
10
10
  'error',
@@ -4,7 +4,8 @@
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.default = {
7
- extends: './configs/base',
7
+ parser: '@graphql-eslint/eslint-plugin',
8
+ plugins: ['@graphql-eslint'],
8
9
  rules: {
9
10
  '@graphql-eslint/executable-definitions': 'error',
10
11
  '@graphql-eslint/fields-on-correct-type': 'error',
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = {
4
- extends: './configs/base',
4
+ parser: '@graphql-eslint/eslint-plugin',
5
+ plugins: ['@graphql-eslint'],
5
6
  rules: {
6
7
  '@graphql-eslint/relay-arguments': 'error',
7
8
  '@graphql-eslint/relay-connection-types': 'error',
@@ -4,7 +4,7 @@
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.default = {
7
- extends: ['./configs/base', './configs/schema-recommended'],
7
+ extends: './configs/schema-recommended',
8
8
  rules: {
9
9
  '@graphql-eslint/alphabetize': [
10
10
  'error',
@@ -4,7 +4,8 @@
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.default = {
7
- extends: './configs/base',
7
+ parser: '@graphql-eslint/eslint-plugin',
8
+ plugins: ['@graphql-eslint'],
8
9
  rules: {
9
10
  '@graphql-eslint/description-style': 'error',
10
11
  '@graphql-eslint/known-argument-names': 'error',
@@ -28,7 +28,7 @@ exports.rule = {
28
28
  type: 'suggestion',
29
29
  docs: {
30
30
  category: 'Operations',
31
- description: 'Require all queries, mutations, subscriptions and fragments to be located in separate files.',
31
+ description: 'Require queries, mutations, subscriptions or fragments to be located in separate files.',
32
32
  url: `https://github.com/B2o5T/graphql-eslint/blob/master/docs/rules/${RULE_ID}.md`,
33
33
  examples: [
34
34
  {
@@ -23,9 +23,6 @@ exports.rule = {
23
23
  {
24
24
  user {
25
25
  ...UserFields
26
- friends {
27
- ...UserFields
28
- }
29
26
  }
30
27
  }
31
28
  `,
@@ -40,6 +37,9 @@ exports.rule = {
40
37
  {
41
38
  user {
42
39
  ...UserFields
40
+ friends {
41
+ ...UserFields
42
+ }
43
43
  }
44
44
  }
45
45
  `,
@@ -8,7 +8,7 @@ exports.rule = {
8
8
  type: 'suggestion',
9
9
  docs: {
10
10
  category: 'Schema',
11
- description: 'Require are `input` or `type` fields be non nullable with `@oneOf` directive.',
11
+ description: 'Require `input` or `type` fields to be non-nullable with `@oneOf` directive.',
12
12
  url: `https://github.com/B2o5T/graphql-eslint/blob/master/docs/rules/${RULE_ID}.md`,
13
13
  examples: [
14
14
  {
package/docs/README.md CHANGED
@@ -26,7 +26,7 @@ Name            &nbs
26
26
  [known-fragment-names](rules/known-fragment-names.md)|A GraphQL document is only valid if all `...Fragment` fragment spreads refer to fragments defined in the same document.|![recommended][]|📦|🔮|
27
27
  [known-type-names](rules/known-type-names.md)|A GraphQL document is only valid if referenced types (specifically variable definitions and fragment conditions) are defined by the type schema.|![recommended][]|📄 📦|🔮|💡
28
28
  [lone-anonymous-operation](rules/lone-anonymous-operation.md)|A GraphQL document that contains an anonymous operation (the `query` short-hand) is only valid if it contains only that one operation definition.|![recommended][]|📦|🔮|
29
- [lone-executable-definition](rules/lone-executable-definition.md)|Require all queries, mutations, subscriptions and fragments to be located in separate files.|![all][]|📦|🚀|
29
+ [lone-executable-definition](rules/lone-executable-definition.md)|Require queries, mutations, subscriptions or fragments to be located in separate files.|![all][]|📦|🚀|
30
30
  [lone-schema-definition](rules/lone-schema-definition.md)|A GraphQL document is only valid if it contains only one schema definition.|![recommended][]|📄|🔮|
31
31
  [match-document-filename](rules/match-document-filename.md)|This rule allows you to enforce that the file name should match the operation name.|![all][]|📦|🚀|
32
32
  [naming-convention](rules/naming-convention.md)|Require names to follow specified conventions.|![recommended][]|📄 📦|🚀|💡
@@ -59,7 +59,7 @@ Name            &nbs
59
59
  [require-description](rules/require-description.md)|Enforce descriptions in type definitions and operations.|![recommended][]|📄|🚀|
60
60
  [require-field-of-type-query-in-mutation-result](rules/require-field-of-type-query-in-mutation-result.md)|Allow the client in one round-trip not only to call mutation but also to get a wagon of data to update their application.|![all][]|📄|🚀|
61
61
  [require-id-when-available](rules/require-id-when-available.md)|Enforce selecting specific fields when they are available on the GraphQL type.|![recommended][]|📦|🚀|💡
62
- [require-nullable-fields-with-oneof](rules/require-nullable-fields-with-oneof.md)|Require are `input` or `type` fields be non nullable with `@oneOf` directive.|![all][]|📄|🚀|
62
+ [require-nullable-fields-with-oneof](rules/require-nullable-fields-with-oneof.md)|Require `input` or `type` fields to be non-nullable with `@oneOf` directive.|![all][]|📄|🚀|
63
63
  [require-type-pattern-with-oneof](rules/require-type-pattern-with-oneof.md)|Enforce types with `@oneOf` directive have `error` and `ok` fields.|![all][]|📄|🚀|
64
64
  [scalar-leafs](rules/scalar-leafs.md)|A GraphQL document is valid only if all leaf fields (fields without sub selections) are of scalar or enum types.|![recommended][]|📦|🔮|💡
65
65
  [selection-set-depth](rules/selection-set-depth.md)|Limit the complexity of the GraphQL operations solely by their depth. Based on [graphql-depth-limit](https://npmjs.com/package/graphql-depth-limit).|![recommended][]|📦|🚀|💡
@@ -6,7 +6,7 @@
6
6
  - Requires GraphQL Operations: `false`
7
7
  [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
8
8
 
9
- Require all queries, mutations, subscriptions and fragments to be located in separate files.
9
+ Require queries, mutations, subscriptions or fragments to be located in separate files.
10
10
 
11
11
  ## Usage Examples
12
12
 
@@ -22,9 +22,6 @@ fragment UserFields on User {
22
22
  {
23
23
  user {
24
24
  ...UserFields
25
- friends {
26
- ...UserFields
27
- }
28
25
  }
29
26
  }
30
27
  ```
@@ -41,6 +38,9 @@ fragment UserFields on User {
41
38
  {
42
39
  user {
43
40
  ...UserFields
41
+ friends {
42
+ ...UserFields
43
+ }
44
44
  }
45
45
  }
46
46
  ```
@@ -6,7 +6,7 @@
6
6
  - Requires GraphQL Operations: `false`
7
7
  [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
8
8
 
9
- Require are `input` or `type` fields be non nullable with `@oneOf` directive.
9
+ Require `input` or `type` fields to be non-nullable with `@oneOf` directive.
10
10
 
11
11
  ## Usage Examples
12
12
 
@@ -2,7 +2,7 @@
2
2
  * 🚨 IMPORTANT! Do not manually modify this file. Run: `yarn generate-configs`
3
3
  */
4
4
  export default {
5
- extends: ['./configs/base', './configs/operations-recommended'],
5
+ extends: './configs/operations-recommended',
6
6
  rules: {
7
7
  '@graphql-eslint/alphabetize': [
8
8
  'error',
@@ -2,7 +2,8 @@
2
2
  * 🚨 IMPORTANT! Do not manually modify this file. Run: `yarn generate-configs`
3
3
  */
4
4
  export default {
5
- extends: './configs/base',
5
+ parser: '@graphql-eslint/eslint-plugin',
6
+ plugins: ['@graphql-eslint'],
6
7
  rules: {
7
8
  '@graphql-eslint/executable-definitions': 'error',
8
9
  '@graphql-eslint/fields-on-correct-type': 'error',
@@ -1,5 +1,6 @@
1
1
  export default {
2
- extends: './configs/base',
2
+ parser: '@graphql-eslint/eslint-plugin',
3
+ plugins: ['@graphql-eslint'],
3
4
  rules: {
4
5
  '@graphql-eslint/relay-arguments': 'error',
5
6
  '@graphql-eslint/relay-connection-types': 'error',
@@ -2,7 +2,7 @@
2
2
  * 🚨 IMPORTANT! Do not manually modify this file. Run: `yarn generate-configs`
3
3
  */
4
4
  export default {
5
- extends: ['./configs/base', './configs/schema-recommended'],
5
+ extends: './configs/schema-recommended',
6
6
  rules: {
7
7
  '@graphql-eslint/alphabetize': [
8
8
  'error',
@@ -2,7 +2,8 @@
2
2
  * 🚨 IMPORTANT! Do not manually modify this file. Run: `yarn generate-configs`
3
3
  */
4
4
  export default {
5
- extends: './configs/base',
5
+ parser: '@graphql-eslint/eslint-plugin',
6
+ plugins: ['@graphql-eslint'],
6
7
  rules: {
7
8
  '@graphql-eslint/description-style': 'error',
8
9
  '@graphql-eslint/known-argument-names': 'error',
@@ -25,7 +25,7 @@ export const rule = {
25
25
  type: 'suggestion',
26
26
  docs: {
27
27
  category: 'Operations',
28
- description: 'Require all queries, mutations, subscriptions and fragments to be located in separate files.',
28
+ description: 'Require queries, mutations, subscriptions or fragments to be located in separate files.',
29
29
  url: `https://github.com/B2o5T/graphql-eslint/blob/master/docs/rules/${RULE_ID}.md`,
30
30
  examples: [
31
31
  {
@@ -20,9 +20,6 @@ export const rule = {
20
20
  {
21
21
  user {
22
22
  ...UserFields
23
- friends {
24
- ...UserFields
25
- }
26
23
  }
27
24
  }
28
25
  `,
@@ -37,6 +34,9 @@ export const rule = {
37
34
  {
38
35
  user {
39
36
  ...UserFields
37
+ friends {
38
+ ...UserFields
39
+ }
40
40
  }
41
41
  }
42
42
  `,
@@ -5,7 +5,7 @@ export const rule = {
5
5
  type: 'suggestion',
6
6
  docs: {
7
7
  category: 'Schema',
8
- description: 'Require are `input` or `type` fields be non nullable with `@oneOf` directive.',
8
+ description: 'Require `input` or `type` fields to be non-nullable with `@oneOf` directive.',
9
9
  url: `https://github.com/B2o5T/graphql-eslint/blob/master/docs/rules/${RULE_ID}.md`,
10
10
  examples: [
11
11
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-eslint/eslint-plugin",
3
- "version": "3.14.0",
3
+ "version": "3.14.1-alpha-20221227103351-5f80ba8",
4
4
  "description": "GraphQL plugin for ESLint",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {
@@ -16,7 +16,8 @@
16
16
  "fast-glob": "^3.2.12",
17
17
  "graphql-config": "^4.4.0",
18
18
  "graphql-depth-limit": "^1.1.0",
19
- "lodash.lowercase": "^4.3.0"
19
+ "lodash.lowercase": "^4.3.0",
20
+ "tslib": "^2.4.1"
20
21
  },
21
22
  "repository": "https://github.com/B2o5T/graphql-eslint",
22
23
  "keywords": [
@@ -1,6 +1,7 @@
1
1
  export declare const configs: {
2
2
  'schema-recommended': {
3
- extends: string;
3
+ parser: string;
4
+ plugins: string[];
4
5
  rules: {
5
6
  '@graphql-eslint/description-style': string;
6
7
  '@graphql-eslint/known-argument-names': string;
@@ -46,7 +47,7 @@ export declare const configs: {
46
47
  };
47
48
  };
48
49
  'schema-all': {
49
- extends: string[];
50
+ extends: string;
50
51
  rules: {
51
52
  '@graphql-eslint/alphabetize': (string | {
52
53
  fields: string[];
@@ -62,7 +63,8 @@ export declare const configs: {
62
63
  };
63
64
  };
64
65
  'operations-recommended': {
65
- extends: string;
66
+ parser: string;
67
+ plugins: string[];
66
68
  rules: {
67
69
  '@graphql-eslint/executable-definitions': string;
68
70
  '@graphql-eslint/fields-on-correct-type': string;
@@ -111,7 +113,7 @@ export declare const configs: {
111
113
  };
112
114
  };
113
115
  'operations-all': {
114
- extends: string[];
116
+ extends: string;
115
117
  rules: {
116
118
  '@graphql-eslint/alphabetize': (string | {
117
119
  selections: string[];
@@ -131,7 +133,8 @@ export declare const configs: {
131
133
  };
132
134
  };
133
135
  relay: {
134
- extends: string;
136
+ parser: string;
137
+ plugins: string[];
135
138
  rules: {
136
139
  '@graphql-eslint/relay-arguments': string;
137
140
  '@graphql-eslint/relay-connection-types': string;
@@ -1,6 +1,7 @@
1
1
  export declare const configs: {
2
2
  'schema-recommended': {
3
- extends: string;
3
+ parser: string;
4
+ plugins: string[];
4
5
  rules: {
5
6
  '@graphql-eslint/description-style': string;
6
7
  '@graphql-eslint/known-argument-names': string;
@@ -46,7 +47,7 @@ export declare const configs: {
46
47
  };
47
48
  };
48
49
  'schema-all': {
49
- extends: string[];
50
+ extends: string;
50
51
  rules: {
51
52
  '@graphql-eslint/alphabetize': (string | {
52
53
  fields: string[];
@@ -62,7 +63,8 @@ export declare const configs: {
62
63
  };
63
64
  };
64
65
  'operations-recommended': {
65
- extends: string;
66
+ parser: string;
67
+ plugins: string[];
66
68
  rules: {
67
69
  '@graphql-eslint/executable-definitions': string;
68
70
  '@graphql-eslint/fields-on-correct-type': string;
@@ -111,7 +113,7 @@ export declare const configs: {
111
113
  };
112
114
  };
113
115
  'operations-all': {
114
- extends: string[];
116
+ extends: string;
115
117
  rules: {
116
118
  '@graphql-eslint/alphabetize': (string | {
117
119
  selections: string[];
@@ -131,7 +133,8 @@ export declare const configs: {
131
133
  };
132
134
  };
133
135
  relay: {
134
- extends: string;
136
+ parser: string;
137
+ plugins: string[];
135
138
  rules: {
136
139
  '@graphql-eslint/relay-arguments': string;
137
140
  '@graphql-eslint/relay-connection-types': string;
@@ -1,5 +1,5 @@
1
1
  declare const _default: {
2
- extends: string[];
2
+ extends: string;
3
3
  rules: {
4
4
  '@graphql-eslint/alphabetize': (string | {
5
5
  selections: string[];
@@ -1,5 +1,5 @@
1
1
  declare const _default: {
2
- extends: string[];
2
+ extends: string;
3
3
  rules: {
4
4
  '@graphql-eslint/alphabetize': (string | {
5
5
  selections: string[];
@@ -1,5 +1,6 @@
1
1
  declare const _default: {
2
- extends: string;
2
+ parser: string;
3
+ plugins: string[];
3
4
  rules: {
4
5
  '@graphql-eslint/executable-definitions': string;
5
6
  '@graphql-eslint/fields-on-correct-type': string;
@@ -1,5 +1,6 @@
1
1
  declare const _default: {
2
- extends: string;
2
+ parser: string;
3
+ plugins: string[];
3
4
  rules: {
4
5
  '@graphql-eslint/executable-definitions': string;
5
6
  '@graphql-eslint/fields-on-correct-type': string;
@@ -1,5 +1,6 @@
1
1
  declare const _default: {
2
- extends: string;
2
+ parser: string;
3
+ plugins: string[];
3
4
  rules: {
4
5
  '@graphql-eslint/relay-arguments': string;
5
6
  '@graphql-eslint/relay-connection-types': string;
@@ -1,5 +1,6 @@
1
1
  declare const _default: {
2
- extends: string;
2
+ parser: string;
3
+ plugins: string[];
3
4
  rules: {
4
5
  '@graphql-eslint/relay-arguments': string;
5
6
  '@graphql-eslint/relay-connection-types': string;
@@ -1,5 +1,5 @@
1
1
  declare const _default: {
2
- extends: string[];
2
+ extends: string;
3
3
  rules: {
4
4
  '@graphql-eslint/alphabetize': (string | {
5
5
  fields: string[];
@@ -1,5 +1,5 @@
1
1
  declare const _default: {
2
- extends: string[];
2
+ extends: string;
3
3
  rules: {
4
4
  '@graphql-eslint/alphabetize': (string | {
5
5
  fields: string[];
@@ -1,5 +1,6 @@
1
1
  declare const _default: {
2
- extends: string;
2
+ parser: string;
3
+ plugins: string[];
3
4
  rules: {
4
5
  '@graphql-eslint/description-style': string;
5
6
  '@graphql-eslint/known-argument-names': string;
@@ -1,5 +1,6 @@
1
1
  declare const _default: {
2
- extends: string;
2
+ parser: string;
3
+ plugins: string[];
3
4
  rules: {
4
5
  '@graphql-eslint/description-style': string;
5
6
  '@graphql-eslint/known-argument-names': string;
@@ -1,4 +0,0 @@
1
- export default {
2
- parser: '@graphql-eslint/eslint-plugin',
3
- plugins: ['@graphql-eslint'],
4
- };
@@ -1,5 +0,0 @@
1
- declare const _default: {
2
- parser: string;
3
- plugins: string[];
4
- };
5
- export default _default;
@@ -1,5 +0,0 @@
1
- declare const _default: {
2
- parser: string;
3
- plugins: string[];
4
- };
5
- export default _default;