-
Notifications
You must be signed in to change notification settings - Fork 47
/
eslint-plugin-relay.js
77 lines (75 loc) · 2.78 KB
/
eslint-plugin-relay.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
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
module.exports = {
rules: {
'graphql-syntax': require('./src/rule-graphql-syntax'),
'compat-uses-vars': require('./src/rule-compat-uses-vars'),
'graphql-naming': require('./src/rule-graphql-naming'),
'generated-flow-types': require('./src/rule-generated-flow-types'),
'generated-typescript-types': require('./src/rule-generated-typescript-types'),
'no-future-added-value': require('./src/rule-no-future-added-value'),
'unused-fields': require('./src/rule-unused-fields'),
'must-colocate-fragment-spreads': require('./src/rule-must-colocate-fragment-spreads'),
'function-required-argument': require('./src/rule-function-required-argument'),
'hook-required-argument': require('./src/rule-hook-required-argument')
},
configs: {
recommended: {
rules: {
'relay/graphql-syntax': 'error',
'relay/compat-uses-vars': 'warn',
'relay/graphql-naming': 'error',
'relay/generated-flow-types': 'warn',
'relay/no-future-added-value': 'warn',
'relay/unused-fields': 'warn',
'relay/must-colocate-fragment-spreads': 'warn',
'relay/function-required-argument': 'warn',
'relay/hook-required-argument': 'warn'
}
},
'ts-recommended': {
rules: {
'relay/graphql-syntax': 'error',
'relay/compat-uses-vars': 'warn',
'relay/graphql-naming': 'error',
'relay/generated-typescript-types': 'warn',
'relay/no-future-added-value': 'warn',
'relay/unused-fields': 'warn',
'relay/must-colocate-fragment-spreads': 'warn',
'relay/function-required-argument': 'warn',
'relay/hook-required-argument': 'warn'
}
},
strict: {
rules: {
'relay/graphql-syntax': 'error',
'relay/compat-uses-vars': 'error',
'relay/graphql-naming': 'error',
'relay/generated-flow-types': 'error',
'relay/no-future-added-value': 'error',
'relay/unused-fields': 'error',
'relay/must-colocate-fragment-spreads': 'error',
'relay/function-required-argument': 'error',
'relay/hook-required-argument': 'error'
}
},
'ts-strict': {
rules: {
'relay/graphql-syntax': 'error',
'relay/compat-uses-vars': 'error',
'relay/graphql-naming': 'error',
'relay/generated-typescript-types': 'error',
'relay/no-future-added-value': 'error',
'relay/unused-fields': 'error',
'relay/must-colocate-fragment-spreads': 'error',
'relay/function-required-argument': 'error',
'relay/hook-required-argument': 'error'
}
}
}
};