|
1 |
| -module.exports = { |
2 |
| - overrides: [ |
3 |
| - { |
4 |
| - files: ['*.graphql', '*.gql'], |
5 |
| - parser: '@graphql-eslint/eslint-plugin', |
6 |
| - plugins: ['@graphql-eslint'], |
7 |
| - rules: { |
8 |
| - '@graphql-eslint/alphabetize': 0, |
9 |
| - // Enforce all comments to be block comments |
10 |
| - '@graphql-eslint/description-style': 0, |
11 |
| - '@graphql-eslint/executable-definitions': 0, |
12 |
| - '@graphql-eslint/fields-on-correct-type': 2, |
13 |
| - '@graphql-eslint/fragments-on-composite-type': 2, |
14 |
| - // This rule is deactivated because it is not compatible with |
15 |
| - // naming input types PascalCase but mutations camelCase |
16 |
| - // https://github.com/dotansimha/graphql-eslint/blob/a2b71f6be17ff57614f57b3648ae2256cc834ea9/docs/rules/input-name.md |
17 |
| - '@graphql-eslint/input-name': 0, |
18 |
| - '@graphql-eslint/known-argument-names': 2, |
19 |
| - '@graphql-eslint/known-directives': 2, |
20 |
| - '@graphql-eslint/known-fragment-names': 2, |
21 |
| - '@graphql-eslint/known-type-names': 2, |
22 |
| - '@graphql-eslint/lone-anonymous-operation': 2, |
23 |
| - '@graphql-eslint/lone-schema-definition': 2, |
24 |
| - '@graphql-eslint/match-document-filename': 0, |
25 |
| - '@graphql-eslint/naming-convention': [ |
26 |
| - 'error', |
27 |
| - { |
28 |
| - ObjectTypeDefinition: 'PascalCase', |
29 |
| - FieldDefinition: 'camelCase', |
30 |
| - InputObjectTypeDefinition: 'PascalCase', |
31 |
| - InputValueDefinition: 'camelCase', |
32 |
| - EnumTypeDefinition: 'PascalCase', |
33 |
| - EnumValueDefinition: 'UPPER_CASE', |
34 |
| - InterfaceTypeDefinition: 'PascalCase', |
35 |
| - UnionTypeDefinition: 'PascalCase', |
36 |
| - ScalarTypeDefinition: 'PascalCase', |
37 |
| - OperationDefinition: 'PascalCase', |
38 |
| - Argument: 'camelCase', |
39 |
| - FragmentDefinition: 'camelCase', |
40 |
| - allowLeadingUnderscore: true, |
41 |
| - allowTrailingUnderscore: false, |
42 |
| - }, |
43 |
| - ], |
| 1 | +import * as graphqlEslint from '@graphql-eslint/eslint-plugin'; |
44 | 2 |
|
45 |
| - '@graphql-eslint/no-anonymous-operations': 2, |
46 |
| - '@graphql-eslint/no-case-insensitive-enum-values-duplicates': 2, |
47 |
| - '@graphql-eslint/no-deprecated': 1, |
48 |
| - '@graphql-eslint/no-duplicate-fields': 2, |
49 |
| - '@graphql-eslint/no-hashtag-description': 2, |
50 |
| - '@graphql-eslint/no-fragment-cycles': 2, |
51 |
| - '@graphql-eslint/no-root-type': 0, |
52 |
| - // What errors does this rule prevent? |
53 |
| - '@graphql-eslint/no-scalar-result-type-on-mutation': 0, |
54 |
| - '@graphql-eslint/no-typename-prefix': 2, |
55 |
| - '@graphql-eslint/no-undefined-variables': 2, |
56 |
| - '@graphql-eslint/no-unreachable-types': 2, |
57 |
| - '@graphql-eslint/no-unused-fields': 1, |
58 |
| - '@graphql-eslint/no-unused-fragments': 2, |
59 |
| - '@graphql-eslint/no-unused-variables': 2, |
| 3 | +export default [ |
| 4 | + { |
| 5 | + files: ['**/*.{gql,graphql}'], |
| 6 | + plugins: { |
| 7 | + '@graphql-eslint': graphqlEslint, |
| 8 | + }, |
| 9 | + languageOptions: { |
| 10 | + parser: graphqlEslint, |
| 11 | + }, |
| 12 | + rules: { |
| 13 | + '@graphql-eslint/alphabetize': 'off', |
| 14 | + // Enforce all comments to be block comments |
| 15 | + '@graphql-eslint/description-style': 'off', |
| 16 | + '@graphql-eslint/executable-definitions': 'off', |
| 17 | + '@graphql-eslint/fields-on-correct-type': 'error', |
| 18 | + '@graphql-eslint/fragments-on-composite-type': 'error', |
| 19 | + // This rule is deactivated because it is not compatible with |
| 20 | + // naming input types PascalCase but mutations camelCase |
| 21 | + // https://github.com/dotansimha/graphql-eslint/blob/a2b71f6be17ff57614f57b3648ae2256cc834ea9/docs/rules/input-name.md |
| 22 | + '@graphql-eslint/input-name': 'off', |
| 23 | + '@graphql-eslint/known-argument-names': 'error', |
| 24 | + '@graphql-eslint/known-directives': 'error', |
| 25 | + '@graphql-eslint/known-fragment-names': 'error', |
| 26 | + '@graphql-eslint/known-type-names': 'error', |
| 27 | + '@graphql-eslint/lone-anonymous-operation': 'error', |
| 28 | + '@graphql-eslint/lone-schema-definition': 'error', |
| 29 | + '@graphql-eslint/match-document-filename': 'off', |
| 30 | + '@graphql-eslint/naming-convention': [ |
| 31 | + 'error', |
| 32 | + { |
| 33 | + ObjectTypeDefinition: 'PascalCase', |
| 34 | + FieldDefinition: 'camelCase', |
| 35 | + InputObjectTypeDefinition: 'PascalCase', |
| 36 | + InputValueDefinition: 'camelCase', |
| 37 | + EnumTypeDefinition: 'PascalCase', |
| 38 | + EnumValueDefinition: 'UPPER_CASE', |
| 39 | + InterfaceTypeDefinition: 'PascalCase', |
| 40 | + UnionTypeDefinition: 'PascalCase', |
| 41 | + ScalarTypeDefinition: 'PascalCase', |
| 42 | + OperationDefinition: 'PascalCase', |
| 43 | + Argument: 'camelCase', |
| 44 | + FragmentDefinition: 'camelCase', |
| 45 | + allowLeadingUnderscore: true, |
| 46 | + allowTrailingUnderscore: false, |
| 47 | + }, |
| 48 | + ], |
| 49 | + |
| 50 | + '@graphql-eslint/no-anonymous-operations': 'error', |
| 51 | + '@graphql-eslint/no-case-insensitive-enum-values-duplicates': 'error', |
| 52 | + '@graphql-eslint/no-deprecated': 'warn', |
| 53 | + '@graphql-eslint/no-duplicate-fields': 'error', |
| 54 | + '@graphql-eslint/no-hashtag-description': 'error', |
| 55 | + '@graphql-eslint/no-fragment-cycles': 'error', |
| 56 | + '@graphql-eslint/no-root-type': 'off', |
| 57 | + // What errors does this rule prevent? |
| 58 | + '@graphql-eslint/no-scalar-result-type-on-mutation': 'off', |
| 59 | + '@graphql-eslint/no-typename-prefix': 'error', |
| 60 | + '@graphql-eslint/no-undefined-variables': 'error', |
| 61 | + '@graphql-eslint/no-unreachable-types': 'error', |
| 62 | + '@graphql-eslint/no-unused-fields': 'warn', |
| 63 | + '@graphql-eslint/no-unused-fragments': 'error', |
| 64 | + '@graphql-eslint/no-unused-variables': 'error', |
60 | 65 |
|
61 |
| - '@graphql-eslint/overlapping-fields-can-be-merged': 2, |
62 |
| - '@graphql-eslint/possible-fragment-spread': 2, |
63 |
| - '@graphql-eslint/possible-type-extension': 2, |
64 |
| - '@graphql-eslint/provided-required-arguments': 2, |
| 66 | + '@graphql-eslint/overlapping-fields-can-be-merged': 'error', |
| 67 | + '@graphql-eslint/possible-fragment-spread': 'error', |
| 68 | + '@graphql-eslint/possible-type-extension': 'error', |
| 69 | + '@graphql-eslint/provided-required-arguments': 'error', |
65 | 70 |
|
66 |
| - '@graphql-eslint/relay-arguments': 0, |
67 |
| - '@graphql-eslint/relay-connection-types ': 0, |
68 |
| - '@graphql-eslint/relay-edge-types': 0, |
69 |
| - '@graphql-eslint/relay-page-info': 0, |
| 71 | + '@graphql-eslint/relay-arguments': 'off', |
| 72 | + '@graphql-eslint/relay-connection-types ': 'off', |
| 73 | + '@graphql-eslint/relay-edge-types': 'off', |
| 74 | + '@graphql-eslint/relay-page-info': 'off', |
70 | 75 |
|
71 |
| - '@graphql-eslint/require-deprecation-date': 0, |
72 |
| - '@graphql-eslint/require-deprecation-reason': 2, |
73 |
| - '@graphql-eslint/require-description': 0, |
74 |
| - '@graphql-eslint/require-field-of-type-query-in-mutation-result': 0, |
75 |
| - '@graphql-eslint/require-id-when-available': 2, |
| 76 | + '@graphql-eslint/require-deprecation-date': 'off', |
| 77 | + '@graphql-eslint/require-deprecation-reason': 'error', |
| 78 | + '@graphql-eslint/require-description': 'off', |
| 79 | + '@graphql-eslint/require-field-of-type-query-in-mutation-result': 'off', |
| 80 | + '@graphql-eslint/require-id-when-available': 'error', |
76 | 81 |
|
77 |
| - '@graphql-eslint/scalar-leafs': 2, |
78 |
| - '@graphql-eslint/selection-set-depth': 0, |
79 |
| - '@graphql-eslint/strict-id-in-types': 0, |
| 82 | + '@graphql-eslint/scalar-leafs': 'error', |
| 83 | + '@graphql-eslint/selection-set-depth': 'off', |
| 84 | + '@graphql-eslint/strict-id-in-types': 'off', |
80 | 85 |
|
81 |
| - '@graphql-eslint/unique-argument-names': 2, |
82 |
| - '@graphql-eslint/unique-directive-names': 2, |
83 |
| - '@graphql-eslint/unique-directive-names-per-location': 2, |
84 |
| - '@graphql-eslint/unique-enum-value-names': 2, |
85 |
| - '@graphql-eslint/unique-field-definition-names': 2, |
86 |
| - '@graphql-eslint/unique-fragment-name': 2, |
87 |
| - '@graphql-eslint/unique-input-field-names': 2, |
88 |
| - '@graphql-eslint/unique-operation-name': 2, |
89 |
| - '@graphql-eslint/unique-operation-types': 2, |
90 |
| - '@graphql-eslint/unique-type-names': 2, |
91 |
| - '@graphql-eslint/unique-variable-names': 2, |
| 86 | + '@graphql-eslint/unique-argument-names': 'error', |
| 87 | + '@graphql-eslint/unique-directive-names': 'error', |
| 88 | + '@graphql-eslint/unique-directive-names-per-location': 'error', |
| 89 | + '@graphql-eslint/unique-enum-value-names': 'error', |
| 90 | + '@graphql-eslint/unique-field-definition-names': 'error', |
| 91 | + '@graphql-eslint/unique-fragment-name': 'error', |
| 92 | + '@graphql-eslint/unique-input-field-names': 'error', |
| 93 | + '@graphql-eslint/unique-operation-name': 'error', |
| 94 | + '@graphql-eslint/unique-operation-types': 'error', |
| 95 | + '@graphql-eslint/unique-type-names': 'error', |
| 96 | + '@graphql-eslint/unique-variable-names': 'error', |
92 | 97 |
|
93 |
| - '@graphql-eslint/value-literals-of-correct-type': 2, |
94 |
| - '@graphql-eslint/variables-are-input-types': 2, |
95 |
| - '@graphql-eslint/variables-in-allowed-position': 2, |
96 |
| - strict: 0, |
97 |
| - }, |
| 98 | + '@graphql-eslint/value-literals-of-correct-type': 'error', |
| 99 | + '@graphql-eslint/variables-are-input-types': 'error', |
| 100 | + '@graphql-eslint/variables-in-allowed-position': 'error', |
| 101 | + strict: 'off', |
98 | 102 | },
|
99 |
| - ], |
100 |
| -}; |
| 103 | + }, |
| 104 | +]; |
0 commit comments