-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
103 lines (95 loc) · 2.34 KB
/
.eslintrc.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
module.exports = {
env: {
browser: true,
es2021: true,
node: true
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 12,
sourceType: 'module',
},
plugins: ['@typescript-eslint', 'sort-keys-fix',
'graphql'
],
rules:
{
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-unused-vars': [2, {
'argsIgnorePattern': '^_',
'varsIgnorePattern': '^_'
}],
'arrow-spacing': 'error',
'brace-style': 'error',
// 'comma-dangle' : ['error', 'always-multiline' ],
'comma-spacing': [
'error',
{
after: true,
},
],
'comma-style': 'error',
complexity: [
'error',
{
max: 7,
},
],
'eol-last': ['error', 'always'],
eqeqeq: 'error',
'graphql/template-strings': ['error', {
// Import default settings for your GraphQL client. Supported values:
// 'apollo', 'relay', 'lokka', 'fraql', 'literal'
env: 'apollo',
// Import your schema JSON here
schemaJson: require('./src/schema.json'),
// OR provide absolute path to your schema JSON
// schemaJsonFilepath: path.resolve(__dirname, './schema.json'),
// OR provide the schema in the Schema Language format
// schemaString: printSchema(schema),
}],
indent: ['error', 2],
'jsx-quotes': ['error', 'prefer-single'],
'key-spacing': ['error', { 'align': 'colon' }],
'max-depth': [
'error',
{
max: 8,
},
],
'newline-per-chained-call': [
'error',
{
ignoreChainWithDepth: 2,
},
],
'no-empty-pattern': 'off',
'no-multiple-empty-lines': [
'error',
{
max: 1,
},
],
'no-unneeded-ternary': 'error',
'no-var': 'error',
'object-property-newline': 'error',
'prefer-arrow-callback': 'error',
'prefer-const': 'error',
'prefer-destructuring': 'error',
'prefer-exponentiation-operator': 'error',
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'prefer-template': 'error',
quotes: ['error', 'single'],
'rest-spread-spacing': ['error', 'never'],
semi: ['error', 'never'],
'sort-keys-fix/sort-keys-fix': 'error'
},
}