forked from gajus/eslint-config-canonical
-
Notifications
You must be signed in to change notification settings - Fork 0
/
graphql.js
87 lines (87 loc) · 3.09 KB
/
graphql.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
module.exports.recommended = {
files: ['**/*.graphql'],
languageOptions: {
parser: require('@graphql-eslint/eslint-plugin'),
},
plugins: {
'@graphql-eslint': require('@graphql-eslint/eslint-plugin'),
},
rules: {
'@graphql-eslint/alphabetize': [
2,
{
arguments: [
'FieldDefinition',
'Field',
'DirectiveDefinition',
'Directive',
],
fields: [
'ObjectTypeDefinition',
'InterfaceTypeDefinition',
'InputObjectTypeDefinition',
],
selections: ['OperationDefinition', 'FragmentDefinition'],
values: ['EnumTypeDefinition'],
variables: ['OperationDefinition'],
},
],
'@graphql-eslint/fields-on-correct-type': 2,
'@graphql-eslint/fragments-on-composite-type': 2,
'@graphql-eslint/input-name': 2,
'@graphql-eslint/known-argument-names': 2,
'@graphql-eslint/known-directives': 2,
'@graphql-eslint/known-type-names': 2,
'@graphql-eslint/lone-anonymous-operation': 2,
'@graphql-eslint/lone-schema-definition': 2,
'@graphql-eslint/match-document-filename': [
2,
{
fileExtension: '.graphql',
},
],
'@graphql-eslint/naming-convention': [
2,
{
allowLeadingUnderscore: true,
EnumTypeDefinition: 'PascalCase',
EnumValueDefinition: 'UPPER_CASE',
FieldDefinition: 'camelCase',
InputObjectTypeDefinition: 'PascalCase',
InputValueDefinition: 'camelCase',
InterfaceTypeDefinition: 'PascalCase',
ObjectTypeDefinition: 'PascalCase',
ScalarTypeDefinition: 'PascalCase',
UnionTypeDefinition: 'PascalCase',
},
],
'@graphql-eslint/no-anonymous-operations': 2,
'@graphql-eslint/no-case-insensitive-enum-values-duplicates': 2,
'@graphql-eslint/no-deprecated': 2,
'@graphql-eslint/no-duplicate-fields': 2,
'@graphql-eslint/no-fragment-cycles': 2,
'@graphql-eslint/no-hashtag-description': 2,
'@graphql-eslint/no-scalar-result-type-on-mutation': 2,
'@graphql-eslint/no-typename-prefix': 2,
'@graphql-eslint/no-unreachable-types': 2,
'@graphql-eslint/one-field-subscriptions': 2,
'@graphql-eslint/overlapping-fields-can-be-merged': 2,
'@graphql-eslint/possible-fragment-spread': 2,
'@graphql-eslint/possible-type-extension': 2,
'@graphql-eslint/provided-required-arguments': 2,
'@graphql-eslint/require-deprecation-reason': 2,
'@graphql-eslint/scalar-leafs': 2,
'@graphql-eslint/unique-argument-names': 2,
'@graphql-eslint/unique-directive-names': 2,
'@graphql-eslint/unique-directive-names-per-location': 2,
'@graphql-eslint/unique-enum-value-names': 2,
'@graphql-eslint/unique-field-definition-names': 2,
'@graphql-eslint/unique-input-field-names': 2,
'@graphql-eslint/unique-operation-types': 2,
'@graphql-eslint/unique-type-names': 2,
'@graphql-eslint/unique-variable-names': 2,
'@graphql-eslint/value-literals-of-correct-type': 2,
'@graphql-eslint/variables-are-input-types': 2,
'@graphql-eslint/variables-in-allowed-position': 2,
},
};