-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
183 lines (182 loc) · 5.55 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
const COMPLEXITY_NUMBER = 2;
const INDENT_NUMBER = 2;
module.exports = {
env: {
commonjs: true,
es2021: true,
node: true,
},
extends: 'eslint:recommended',
parserOptions: {
ecmaVersion: 12,
},
rules: {
// possible errors
'for-direction': 'error',
'getter-return': 'error',
'no-await-in-loop': 'error',
'no-compare-neg-zero': 'error',
'no-cond-assign': 'error',
'no-console': ['error', { allow: ['warn', 'error'] }],
'no-constant-condition': 'error',
'no-debugger': 'error',
'no-dupe-args': 'error',
'no-dupe-else-if': 'error',
'no-dupe-keys': 'error',
'no-duplicate-case': 'error',
'no-empty': 'error',
'no-ex-assign': 'error',
'no-extra-boolean-cast': 'error',
'no-extra-parens': 'error',
'no-extra-semi': 'error',
'no-func-assign': 'error',
'no-import-assign': 'error',
'no-inner-declarations': 'error',
'no-irregular-whitespace': 'error',
'no-loss-of-precision': 'error',
'no-misleading-character-class': 'error',
'no-obj-calls': 'error',
'no-promise-executor-return': 'error',
'no-prototype-builtins': 'error',
'no-regex-spaces': 'error',
'no-setter-return': 'error',
'no-unexpected-multiline': 'error',
'no-unreachable': 'error',
'no-unreachable-loop': 'error',
'no-unsafe-finally': 'error',
'no-unsafe-negation': 'error',
'no-unsafe-optional-chaining': 'error',
'require-atomic-updates': 'error',
'use-isnan': 'error',
'valid-typeof': 'error',
// best practices
'block-scoped-var': 'error',
complexity: ['error', COMPLEXITY_NUMBER],
'consistent-return': 'error',
curly: 'error',
'default-case': 'error',
'default-case-last': 'error',
'default-param-last': 'error',
'dot-notation': 'error',
eqeqeq: ['error', 'always'],
'guard-for-in': 'error',
'max-classes-per-file': 'error',
'no-alert': 'error',
'no-caller': 'error',
'no-constructor-return': 'error',
'no-else-return': 'error',
'no-empty-pattern': 'error',
'no-eq-null': 'error',
'no-eval': 'error',
'no-extend-native': 'error',
'no-extra-bind': 'error',
'no-extra-label': 'error',
'no-fallthrough': 'error',
'no-floating-decimal': 'error',
'no-global-assign': 'error',
'no-implicit-coercion': 'error',
'no-implied-eval': 'error',
'no-invalid-this': 'error',
'no-empty-function': 'error',
'no-iterator': 'error',
'no-lone-blocks': 'error',
'no-loop-func': 'error',
'no-magic-numbers': ['error',
{
ignoreArrayIndexes: true,
}],
'no-multi-spaces': 'error',
'no-new': 'error',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-param-reassign': 'error',
'no-proto': 'error',
'no-redeclare': 'error',
'no-return-assign': 'error',
'no-return-await': 'error',
'no-self-assign': 'error',
'no-self-compare': 'error',
'no-throw-literal': 'error',
'no-useless-call': 'error',
'no-useless-concat': 'error',
'no-useless-return': 'error',
'no-void': 'error',
'no-with': 'error',
'wrap-iife': 'error',
'require-await': 'error',
yoda: 'error',
// variables
'no-delete-var': 'error',
'no-shadow': 'error',
'no-unused-vars': 'error',
'no-use-before-define': 'error',
// stylistic issues
'array-bracket-newline': ['error', 'never'],
'array-bracket-spacing': ['error',
'never',
{
singleValue: false,
objectsInArrays: false,
arraysInArrays: false,
}],
'array-element-newline': ['error', 'consistent'],
'block-spacing': 'error',
'brace-style': 'error',
camelcase: ['error',
{
ignoreDestructuring: true,
ignoreImports: true,
}],
'comma-dangle': ['error', 'always-multiline'],
'comma-style': ['error', 'last'],
'computed-property-spacing': ['error', 'never'],
'func-call-spacing': ['error', 'never'],
'func-names': ['error', 'as-needed'],
'func-style': ['error', 'declaration', { allowArrowFunctions: true }],
'implicit-arrow-linebreak': ['error', 'beside'],
'jsx-quotes': ['error', 'prefer-double'],
'key-spacing': ['error', { mode: 'strict' }],
'lines-between-class-members': ['error', 'always'],
'linebreak-style': ['error', 'unix'],
indent: ['error', INDENT_NUMBER],
'max-depth': 'error',
'max-len': ['error',
{
code: 100,
ignoreComments: true,
}],
'newline-per-chained-call': ['error', { ignoreChainWithDepth: 2 }],
'no-bitwise': 'error',
'no-lonely-if': 'error',
'no-mixed-spaces-and-tabs': 'error',
'no-multi-assign': 'error',
'no-multiple-empty-lines': 'error',
'no-negated-condition': 'error',
'no-nested-ternary': 'error',
'no-new-object': 'error',
'no-trailing-spaces': 'error',
'no-unneeded-ternary': 'error',
'no-whitespace-before-property': 'error',
'prefer-object-spread': 'error',
'object-curly-spacing': ['error', 'always'],
'object-property-newline': ['error',
{ allowAllPropertiesOnSameLine: true }],
'one-var': ['error', 'never'],
'operator-linebreak': ['error', 'none'],
'padded-blocks': ['error', 'never'],
'padding-line-between-statements': ['error',
{
blankLine: 'always',
prev: '*',
next: 'return',
}],
quotes: ['error', 'single'],
semi: ['error', 'always'],
'space-before-blocks': 'error',
'space-in-parens': ['error', 'never'],
'space-infix-ops': 'error',
'space-unary-ops': 'error',
'spaced-comment': ['error', 'always'],
'wrap-regex': 'error',
},
};