-
Notifications
You must be signed in to change notification settings - Fork 13
/
.eslintrc.js
88 lines (88 loc) · 1.89 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
module.exports = {
root: true,
plugins: ['jest'],
extends: ['eslint:recommended', 'prettier'],
env: {
node: true,
es6: true,
},
rules: {
complexity: ['warn'],
curly: ['error'],
'default-case': ['error'],
'guard-for-in': ['error'],
'no-array-constructor': ['error'],
'no-else-return': [
'warn',
{
allowElseIf: false,
},
],
'no-implicit-coercion': ['warn'],
'no-lonely-if': ['error'],
'no-loop-func': ['error'],
'no-magic-numbers': ['warn', { ignore: [0, 1, 2, 8] }],
'no-nested-ternary': ['warn'],
'no-new-object': ['error'],
'no-param-reassign': ['warn'],
'no-process-env': ['error'],
'no-return-assign': ['error'],
'no-self-compare': ['error'],
'no-sequences': ['error'],
'no-unmodified-loop-condition': ['error'],
'no-unneeded-ternary': ['warn'],
'no-useless-call': ['error'],
'no-useless-computed-key': ['warn'],
'no-useless-rename': ['warn'],
'no-warning-comments': [
'error',
{
terms: ['fixme', 'fix'],
},
],
'object-shorthand': ['warn'],
'prefer-const': ['error'],
'prefer-rest-params': ['error'],
'prefer-spread': ['warn'],
'prefer-template': ['warn'],
radix: ['error'],
'spaced-comment': ['warn'],
yoda: ['warn'],
},
overrides: [
{
files: ['*.ts'],
plugins: ['@typescript-eslint'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: `${__dirname}/tsconfig.json`,
sourceType: 'module',
},
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
rules: {
'@typescript-eslint/array-type': [
'error',
{
'array-simple': true,
},
],
'@typescript-eslint/strict-boolean-expressions': [
'error',
{
allowString: false,
allowNumber: false,
},
],
},
},
{
files: ['tests/**/*.ts'],
rules: {
'no-magic-numbers': 'off',
},
},
],
}