@ololoepepe/eslint-config 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/package.json +32 -0
- package/src/index.js +629 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# ESLint config
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ololoepepe/eslint-config",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "ESLint config",
|
|
5
|
+
"main": "src/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"lint": "eslint ./src"
|
|
8
|
+
},
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"registry": "https://registry.npmjs.com"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"src",
|
|
14
|
+
"package.json",
|
|
15
|
+
"README.md"
|
|
16
|
+
],
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+ssh://git@ssh.gitlab.void-walkers.com:1022/libs/eslint-config.git"
|
|
20
|
+
},
|
|
21
|
+
"author": "Andrey Bogdanov <ololoepepe@gmail.com>",
|
|
22
|
+
"license": "UNLICENSED",
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://gitlab.void-walkers.com/libs/eslint-config/issues"
|
|
25
|
+
},
|
|
26
|
+
"homepage": "https://gitlab.void-walkers.com/libs/eslint-config#README",
|
|
27
|
+
"dependencies": {},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"eslint": "^8.37.0",
|
|
30
|
+
"eslint-config-xo": "^0.43.1"
|
|
31
|
+
}
|
|
32
|
+
}
|
package/src/index.js
ADDED
|
@@ -0,0 +1,629 @@
|
|
|
1
|
+
module.exports = () => ({
|
|
2
|
+
env: {
|
|
3
|
+
node: true
|
|
4
|
+
},
|
|
5
|
+
parser: '@babel/eslint-parser',
|
|
6
|
+
parserOptions: {
|
|
7
|
+
requireConfigFile: false
|
|
8
|
+
},
|
|
9
|
+
plugins: ['import'],
|
|
10
|
+
rules: {
|
|
11
|
+
'accessor-pairs': ['warn', {
|
|
12
|
+
enforceForClassMembers: true,
|
|
13
|
+
getWithoutSet: false,
|
|
14
|
+
setWithoutGet: true
|
|
15
|
+
}],
|
|
16
|
+
'array-callback-return': ['error', {
|
|
17
|
+
allowImplicit: false,
|
|
18
|
+
checkForEach: false
|
|
19
|
+
}],
|
|
20
|
+
'arrow-body-style': ['error', 'as-needed'],
|
|
21
|
+
'array-bracket-newline': ['error', 'multiline'],
|
|
22
|
+
'array-bracket-spacing': ['error', 'never', {
|
|
23
|
+
arraysInArrays: false,
|
|
24
|
+
objectsInArrays: false,
|
|
25
|
+
singleValue: false
|
|
26
|
+
}],
|
|
27
|
+
'array-element-newline': ['error', 'consistent'],
|
|
28
|
+
'arrow-parens': ['error', 'as-needed', {
|
|
29
|
+
requireForBlockBody: false
|
|
30
|
+
}],
|
|
31
|
+
'arrow-spacing': ['error', {
|
|
32
|
+
after: true,
|
|
33
|
+
before: true
|
|
34
|
+
}],
|
|
35
|
+
'block-scoped-var': 'error',
|
|
36
|
+
'block-spacing': ['error', 'always'],
|
|
37
|
+
'brace-style': ['error', '1tbs', {
|
|
38
|
+
allowSingleLine: false
|
|
39
|
+
}],
|
|
40
|
+
camelcase: ['error', {
|
|
41
|
+
ignoreDestructuring: false,
|
|
42
|
+
ignoreGlobals: true,
|
|
43
|
+
ignoreImports: false,
|
|
44
|
+
properties: 'never'
|
|
45
|
+
}],
|
|
46
|
+
'capitalized-comments': ['error', 'always', {
|
|
47
|
+
ignoreConsecutiveComments: true,
|
|
48
|
+
ignoreInlineComments: false
|
|
49
|
+
}],
|
|
50
|
+
'class-methods-use-this': 'off',
|
|
51
|
+
'comma-dangle': ['error', 'never'],
|
|
52
|
+
'comma-spacing': ['error', {
|
|
53
|
+
after: true,
|
|
54
|
+
before: false
|
|
55
|
+
}],
|
|
56
|
+
'comma-style': ['error', 'last'],
|
|
57
|
+
complexity: ['warn', 20],
|
|
58
|
+
'computed-property-spacing': ['error', 'never', {
|
|
59
|
+
enforceForClassMembers: true
|
|
60
|
+
}],
|
|
61
|
+
'consistent-return': 'off',
|
|
62
|
+
'consistent-this': ['error', 'self'],
|
|
63
|
+
'constructor-super': 'error',
|
|
64
|
+
curly: ['error', 'multi'],
|
|
65
|
+
'default-case': ['error', {
|
|
66
|
+
commentPattern: '^skip\\sdefault'
|
|
67
|
+
}],
|
|
68
|
+
'default-case-last': 'error',
|
|
69
|
+
'default-param-last': 'error',
|
|
70
|
+
'dot-location': ['error', 'property'],
|
|
71
|
+
'dot-notation': ['error', {
|
|
72
|
+
allowKeywords: false
|
|
73
|
+
}],
|
|
74
|
+
'eol-last': ['error', 'always'],
|
|
75
|
+
eqeqeq: ['error', 'always'],
|
|
76
|
+
'for-direction': 'error',
|
|
77
|
+
'func-call-spacing': ['error', 'never'],
|
|
78
|
+
'func-name-matching': ['warn', 'always'],
|
|
79
|
+
'func-names': ['error', 'as-needed', {
|
|
80
|
+
generators: 'as-needed'
|
|
81
|
+
}],
|
|
82
|
+
'func-style': ['error', 'declaration', {
|
|
83
|
+
allowArrowFunctions: true
|
|
84
|
+
}],
|
|
85
|
+
'function-call-argument-newline': ['error', 'consistent'],
|
|
86
|
+
'function-paren-newline': ['error', 'multiline-arguments'],
|
|
87
|
+
'generator-star-spacing': ['error', {
|
|
88
|
+
after: true,
|
|
89
|
+
before: true
|
|
90
|
+
}],
|
|
91
|
+
'getter-return': ['error', {
|
|
92
|
+
allowImplicit: false
|
|
93
|
+
}],
|
|
94
|
+
'grouped-accessor-pairs': ['error', 'getBeforeSet'],
|
|
95
|
+
'guard-for-in': 'error',
|
|
96
|
+
'id-denylist': 'off',
|
|
97
|
+
'id-length': 'off',
|
|
98
|
+
'id-match': 'off',
|
|
99
|
+
'implicit-arrow-linebreak': ['error', 'beside'],
|
|
100
|
+
indent: ['error', 2],
|
|
101
|
+
'init-declarations': ['error', 'always', {
|
|
102
|
+
ignoreForLoopInit: false
|
|
103
|
+
}],
|
|
104
|
+
'jsx-quotes': ['error', 'prefer-double'],
|
|
105
|
+
'key-spacing': ['error', {
|
|
106
|
+
afterColon: true,
|
|
107
|
+
beforeColon: false
|
|
108
|
+
}],
|
|
109
|
+
'keyword-spacing': ['error', {
|
|
110
|
+
after: true,
|
|
111
|
+
before: true
|
|
112
|
+
}],
|
|
113
|
+
'line-comment-position': 'off',
|
|
114
|
+
'linebreak-style': ['error', 'unix'],
|
|
115
|
+
'lines-around-comment': 'off',
|
|
116
|
+
'lines-between-class-members': ['error', 'always', {
|
|
117
|
+
exceptAfterSingleLine: false
|
|
118
|
+
}],
|
|
119
|
+
'logical-assignment-operators': ['error', 'always', {
|
|
120
|
+
enforceForIfStatements: false
|
|
121
|
+
}],
|
|
122
|
+
'max-classes-per-file': 'off',
|
|
123
|
+
'max-depth': ['warn', 5],
|
|
124
|
+
'max-len': ['error', {
|
|
125
|
+
code: 120,
|
|
126
|
+
comments: 120,
|
|
127
|
+
ignoreComments: false,
|
|
128
|
+
ignoreRegExpLiterals: false,
|
|
129
|
+
ignoreStrings: false,
|
|
130
|
+
ignoreTemplateLiterals: false,
|
|
131
|
+
ignoreTrailingComments: false,
|
|
132
|
+
ignoreUrls: false,
|
|
133
|
+
tabWidth: 2
|
|
134
|
+
}],
|
|
135
|
+
'max-lines': ['warn', {
|
|
136
|
+
max: 500,
|
|
137
|
+
skipBlankLines: true,
|
|
138
|
+
skipComments: true
|
|
139
|
+
}],
|
|
140
|
+
'max-lines-per-function': ['warn', {
|
|
141
|
+
IIFEs: true,
|
|
142
|
+
max: 100,
|
|
143
|
+
skipBlankLines: true,
|
|
144
|
+
skipComments: true
|
|
145
|
+
}],
|
|
146
|
+
'max-nested-callbacks': ['warn', 5],
|
|
147
|
+
'max-params': ['warn', 4],
|
|
148
|
+
'max-statements': 'off',
|
|
149
|
+
'max-statements-per-line': ['error', {
|
|
150
|
+
max: 1
|
|
151
|
+
}],
|
|
152
|
+
'multiline-comment-style': 'off',
|
|
153
|
+
'multiline-ternary': 'off',
|
|
154
|
+
'new-cap': ['error', {
|
|
155
|
+
capIsNew: true,
|
|
156
|
+
newIsCap: true,
|
|
157
|
+
properties: true
|
|
158
|
+
}],
|
|
159
|
+
'new-parens': ['error', 'always'],
|
|
160
|
+
'newline-per-chained-call': ['error', {
|
|
161
|
+
ignoreChainWithDepth: 3
|
|
162
|
+
}],
|
|
163
|
+
'no-alert': 'error',
|
|
164
|
+
'no-array-constructor': 'error',
|
|
165
|
+
'no-async-promise-executor': 'error',
|
|
166
|
+
'no-await-in-loop': 'off',
|
|
167
|
+
'no-bitwise': ['warn', {
|
|
168
|
+
allow: [],
|
|
169
|
+
int32Hint: false
|
|
170
|
+
}],
|
|
171
|
+
'no-caller': 'error',
|
|
172
|
+
'no-case-declarations': 'error',
|
|
173
|
+
'no-class-assign': 'error',
|
|
174
|
+
'no-compare-neg-zero': 'error',
|
|
175
|
+
'no-cond-assign': ['error', 'always'],
|
|
176
|
+
'no-confusing-arrow': ['error', {
|
|
177
|
+
allowParens: true,
|
|
178
|
+
onlyOneSimpleParam: false
|
|
179
|
+
}],
|
|
180
|
+
'no-console': 'off',
|
|
181
|
+
'no-const-assign': 'error',
|
|
182
|
+
'no-constant-binary-expression': 'error',
|
|
183
|
+
'no-constant-condition': ['error', {
|
|
184
|
+
checkLoops: false
|
|
185
|
+
}],
|
|
186
|
+
'no-constructor-return': 'error',
|
|
187
|
+
'no-continue': 'off',
|
|
188
|
+
'no-control-regex': 'error',
|
|
189
|
+
'no-debugger': 'error',
|
|
190
|
+
'no-delete-var': 'error',
|
|
191
|
+
'no-div-regex': 'off',
|
|
192
|
+
'no-dupe-args': 'error',
|
|
193
|
+
'no-dupe-class-members': 'error',
|
|
194
|
+
'no-dupe-else-if': 'error',
|
|
195
|
+
'no-dupe-keys': 'error',
|
|
196
|
+
'no-duplicate-case': 'error',
|
|
197
|
+
'no-duplicate-imports': ['error', {
|
|
198
|
+
includeExports: true
|
|
199
|
+
}],
|
|
200
|
+
'no-else-return': ['error', {
|
|
201
|
+
allowElseIf: true
|
|
202
|
+
}],
|
|
203
|
+
'no-empty': ['error', {
|
|
204
|
+
allowEmptyCatch: false
|
|
205
|
+
}],
|
|
206
|
+
'no-empty-character-class': 'error',
|
|
207
|
+
'no-empty-function': ['error', {
|
|
208
|
+
allow: []
|
|
209
|
+
}],
|
|
210
|
+
'no-empty-pattern': 'error',
|
|
211
|
+
'no-empty-static-block': 'error',
|
|
212
|
+
'no-eq-null': 'error',
|
|
213
|
+
'no-eval': ['error', {
|
|
214
|
+
allowIndirect: false
|
|
215
|
+
}],
|
|
216
|
+
'no-ex-assign': 'error',
|
|
217
|
+
'no-extend-native': ['error', {
|
|
218
|
+
exceptions: []
|
|
219
|
+
}],
|
|
220
|
+
'no-extra-bind': 'error',
|
|
221
|
+
'no-extra-boolean-cast': ['error', {
|
|
222
|
+
enforceForLogicalOperands: true
|
|
223
|
+
}],
|
|
224
|
+
'no-extra-label': 'error',
|
|
225
|
+
'no-extra-parens': 'off', // TODO: Reconsider
|
|
226
|
+
'no-extra-semi': 'error',
|
|
227
|
+
'no-fallthrough': ['error', {
|
|
228
|
+
allowEmptyCase: false,
|
|
229
|
+
commentPattern: 'break[\\s\\w]*omitted'
|
|
230
|
+
}],
|
|
231
|
+
'no-floating-decimal': 'error',
|
|
232
|
+
'no-func-assign': 'error',
|
|
233
|
+
'no-global-assign': ['error', {
|
|
234
|
+
exceptions: []
|
|
235
|
+
}],
|
|
236
|
+
'no-implicit-coercion': ['error', {
|
|
237
|
+
allow: [],
|
|
238
|
+
boolean: true,
|
|
239
|
+
disallowTemplateShorthand: true,
|
|
240
|
+
number: true,
|
|
241
|
+
string: true
|
|
242
|
+
}],
|
|
243
|
+
'no-implicit-globals': ['error', {
|
|
244
|
+
lexicalBindings: false
|
|
245
|
+
}],
|
|
246
|
+
'no-implied-eval': 'error',
|
|
247
|
+
'no-import-assign': 'error',
|
|
248
|
+
'no-inline-comments': 'off',
|
|
249
|
+
'no-inner-declarations': ['error', 'both'],
|
|
250
|
+
'no-invalid-regexp': ['error'],
|
|
251
|
+
'no-invalid-this': ['error', {
|
|
252
|
+
capIsConstructor: true
|
|
253
|
+
}],
|
|
254
|
+
'no-irregular-whitespace': ['error', {
|
|
255
|
+
skipComments: true,
|
|
256
|
+
skipRegExps: true,
|
|
257
|
+
skipStrings: true,
|
|
258
|
+
skipTemplates: true
|
|
259
|
+
}],
|
|
260
|
+
'no-iterator': 'error',
|
|
261
|
+
'no-label-var': 'error',
|
|
262
|
+
'no-labels': 'off',
|
|
263
|
+
'no-lone-blocks': 'off',
|
|
264
|
+
'no-lonely-if': 'error',
|
|
265
|
+
'no-loop-func': 'error',
|
|
266
|
+
'no-loss-of-precision': 'error',
|
|
267
|
+
'no-magic-numbers': 'off',
|
|
268
|
+
'no-misleading-character-class': 'error',
|
|
269
|
+
'no-mixed-operators': ['error', {
|
|
270
|
+
allowSamePrecedence: true
|
|
271
|
+
}],
|
|
272
|
+
'no-mixed-spaces-and-tabs': 'error',
|
|
273
|
+
'no-multi-assign': ['error', {
|
|
274
|
+
ignoreNonDeclaration: false
|
|
275
|
+
}],
|
|
276
|
+
'no-multi-spaces': ['error', {
|
|
277
|
+
exceptions: {
|
|
278
|
+
Property: false
|
|
279
|
+
}
|
|
280
|
+
}],
|
|
281
|
+
'no-multi-str': 'error',
|
|
282
|
+
'no-multiple-empty-lines': ['error', {
|
|
283
|
+
max: 1,
|
|
284
|
+
maxBOF: 0,
|
|
285
|
+
maxEOF: 1
|
|
286
|
+
}],
|
|
287
|
+
'no-negated-condition': 'error',
|
|
288
|
+
'no-nested-ternary': 'off',
|
|
289
|
+
'no-new': 'error',
|
|
290
|
+
'no-new-func': 'error',
|
|
291
|
+
'no-new-native-nonconstructor': 'error',
|
|
292
|
+
'no-new-object': 'error',
|
|
293
|
+
'no-new-symbol': 'error',
|
|
294
|
+
'no-new-wrappers': 'error',
|
|
295
|
+
'no-nonoctal-decimal-escape': 'error',
|
|
296
|
+
'no-obj-calls': 'error',
|
|
297
|
+
'no-octal': 'error',
|
|
298
|
+
'no-octal-escape': 'error',
|
|
299
|
+
'no-param-reassign': 'off',
|
|
300
|
+
'no-plusplus': 'off',
|
|
301
|
+
'no-promise-executor-return': 'error',
|
|
302
|
+
'no-proto': 'error',
|
|
303
|
+
'no-prototype-builtins': 'error',
|
|
304
|
+
'no-redeclare': ['error', {
|
|
305
|
+
builtinGlobals: true
|
|
306
|
+
}],
|
|
307
|
+
'no-regex-spaces': 'error',
|
|
308
|
+
'no-restricted-exports': 'off',
|
|
309
|
+
'no-restricted-globals': 'off',
|
|
310
|
+
'no-restricted-imports': 'off',
|
|
311
|
+
'no-restricted-properties': 'off',
|
|
312
|
+
'no-restricted-syntax': 'off',
|
|
313
|
+
'no-return-assign': ['error', 'always'],
|
|
314
|
+
'no-return-await': 'off',
|
|
315
|
+
'no-script-url': 'error',
|
|
316
|
+
'no-sequences': ['error', {
|
|
317
|
+
allowInParentheses: false
|
|
318
|
+
}],
|
|
319
|
+
'no-self-assign': ['error', {
|
|
320
|
+
props: true
|
|
321
|
+
}],
|
|
322
|
+
'no-self-compare': 'error',
|
|
323
|
+
'no-setter-return': 'error',
|
|
324
|
+
'no-shadow': ['error', {
|
|
325
|
+
allow: ['hasOwnProperty', 'length'],
|
|
326
|
+
builtinGlobals: true,
|
|
327
|
+
hoist: 'functions',
|
|
328
|
+
ignoreOnInitialization: false
|
|
329
|
+
}],
|
|
330
|
+
'no-shadow-restricted-names': 'error',
|
|
331
|
+
'no-sparse-arrays': 'error',
|
|
332
|
+
'no-tabs': ['error', {
|
|
333
|
+
allowIndentationTabs: false
|
|
334
|
+
}],
|
|
335
|
+
'no-template-curly-in-string': 'warn',
|
|
336
|
+
'no-ternary': 'off',
|
|
337
|
+
'no-throw-literal': 'error',
|
|
338
|
+
'no-this-before-super': 'error',
|
|
339
|
+
'no-trailing-spaces': ['error', {
|
|
340
|
+
ignoreComments: false,
|
|
341
|
+
skipBlankLines: false
|
|
342
|
+
}],
|
|
343
|
+
'no-undef': ['error', {
|
|
344
|
+
typeof: true
|
|
345
|
+
}],
|
|
346
|
+
'no-undef-init': 'error',
|
|
347
|
+
'no-undefined': 'off',
|
|
348
|
+
'no-underscore-dangle': ['error', {
|
|
349
|
+
allow: [],
|
|
350
|
+
allowAfterSuper: false,
|
|
351
|
+
allowAfterThis: false,
|
|
352
|
+
allowAfterThisConstructor: false,
|
|
353
|
+
allowFunctionParams: false,
|
|
354
|
+
allowInArrayDestructuring: false,
|
|
355
|
+
allowInObjectDestructuring: false,
|
|
356
|
+
enforceInClassFields: true,
|
|
357
|
+
enforceInMethodNames: true
|
|
358
|
+
}],
|
|
359
|
+
'no-unexpected-multiline': 'error',
|
|
360
|
+
'no-unmodified-loop-condition': 'warn',
|
|
361
|
+
'no-unneeded-ternary': ['error', {
|
|
362
|
+
defaultAssignment: false
|
|
363
|
+
}],
|
|
364
|
+
'no-unreachable': 'error',
|
|
365
|
+
'no-unreachable-loop': ['error', {
|
|
366
|
+
ignore: []
|
|
367
|
+
}],
|
|
368
|
+
'no-unsafe-finally': 'error',
|
|
369
|
+
'no-unsafe-negation': ['error', {
|
|
370
|
+
enforceForOrderingRelations: true
|
|
371
|
+
}],
|
|
372
|
+
'no-unsafe-optional-chaining': ['error', {
|
|
373
|
+
disallowArithmeticOperators: true
|
|
374
|
+
}],
|
|
375
|
+
'no-unused-expressions': ['error', {
|
|
376
|
+
allowShortCircuit: false,
|
|
377
|
+
allowTaggedTemplates: false,
|
|
378
|
+
allowTernary: false,
|
|
379
|
+
enforceForJSX: true
|
|
380
|
+
}],
|
|
381
|
+
'no-unused-labels': 'error',
|
|
382
|
+
'no-unused-private-class-members': 'error',
|
|
383
|
+
'no-unused-vars': ['warn', {
|
|
384
|
+
args: 'after-used',
|
|
385
|
+
caughtErrors: 'all',
|
|
386
|
+
ignoreRestSiblings: true,
|
|
387
|
+
vars: 'all'
|
|
388
|
+
}],
|
|
389
|
+
'no-use-before-define': ['error', {
|
|
390
|
+
classes: true,
|
|
391
|
+
functions: false,
|
|
392
|
+
variables: true
|
|
393
|
+
}],
|
|
394
|
+
'no-useless-backreference': 'error',
|
|
395
|
+
'no-useless-call': 'error',
|
|
396
|
+
'no-useless-catch': 'error',
|
|
397
|
+
'no-useless-computed-key': ['error', {
|
|
398
|
+
enforceForClassMembers: true
|
|
399
|
+
}],
|
|
400
|
+
'no-useless-concat': 'error',
|
|
401
|
+
'no-useless-constructor': 'error',
|
|
402
|
+
'no-useless-escape': 'error',
|
|
403
|
+
'no-useless-rename': ['error', {
|
|
404
|
+
ignoreDestructuring: false,
|
|
405
|
+
ignoreExport: false,
|
|
406
|
+
ignoreImport: false
|
|
407
|
+
}],
|
|
408
|
+
'no-useless-return': 'error',
|
|
409
|
+
'no-var': 'error',
|
|
410
|
+
'no-void': ['error', {
|
|
411
|
+
allowAsStatement: false
|
|
412
|
+
}],
|
|
413
|
+
'no-warning-comments': ['warn', {
|
|
414
|
+
decoration: [],
|
|
415
|
+
location: 'start',
|
|
416
|
+
terms: ['fix', 'fixme', 'todo']
|
|
417
|
+
}],
|
|
418
|
+
'no-whitespace-before-property': 'error',
|
|
419
|
+
'no-with': 'error',
|
|
420
|
+
'nonblock-statement-body-position': 'off',
|
|
421
|
+
'object-curly-newline': 'off',
|
|
422
|
+
'object-curly-spacing': ['error', 'never', {
|
|
423
|
+
arraysInObjects: false,
|
|
424
|
+
objectsInObjects: false
|
|
425
|
+
}],
|
|
426
|
+
'object-shorthand': ['error', 'always', {
|
|
427
|
+
avoidExplicitReturnArrows: false,
|
|
428
|
+
avoidQuotes: true,
|
|
429
|
+
ignoreConstructors: false
|
|
430
|
+
}],
|
|
431
|
+
'object-property-newline': 'off', // Reconsider
|
|
432
|
+
'one-var': ['error', 'never'],
|
|
433
|
+
'one-var-declaration-per-line': 'off',
|
|
434
|
+
'operator-assignment': ['error', 'always'],
|
|
435
|
+
'operator-linebreak': ['error', 'after'],
|
|
436
|
+
'padded-blocks': ['error', 'never', {
|
|
437
|
+
allowSingleLineBlocks: false
|
|
438
|
+
}],
|
|
439
|
+
'padding-line-between-statements': ['error', {
|
|
440
|
+
blankLine: 'always',
|
|
441
|
+
next: '*',
|
|
442
|
+
prev: 'multiline-block-like'
|
|
443
|
+
}],
|
|
444
|
+
'prefer-arrow-callback': ['error', {
|
|
445
|
+
allowNamedFunctions: false,
|
|
446
|
+
allowUnboundThis: true
|
|
447
|
+
}],
|
|
448
|
+
'prefer-const': ['error', {
|
|
449
|
+
destructuring: 'all',
|
|
450
|
+
ignoreReadBeforeAssign: true
|
|
451
|
+
}],
|
|
452
|
+
'prefer-destructuring': ['error', {
|
|
453
|
+
array: true,
|
|
454
|
+
object: true
|
|
455
|
+
}, {
|
|
456
|
+
enforceForRenamedProperties: false
|
|
457
|
+
}],
|
|
458
|
+
'prefer-exponentiation-operator': 'error',
|
|
459
|
+
'prefer-named-capture-group': 'warn',
|
|
460
|
+
'prefer-numeric-literals': 'error',
|
|
461
|
+
'prefer-object-has-own': 'off',
|
|
462
|
+
'prefer-object-spread': 'error',
|
|
463
|
+
'prefer-promise-reject-errors': ['error', {
|
|
464
|
+
allowEmptyReject: false
|
|
465
|
+
}],
|
|
466
|
+
'prefer-regex-literals': ['error', {
|
|
467
|
+
disallowRedundantWrapping: true
|
|
468
|
+
}],
|
|
469
|
+
'prefer-rest-params': 'error',
|
|
470
|
+
'prefer-spread': 'error',
|
|
471
|
+
'prefer-template': 'error',
|
|
472
|
+
'quote-props': ['error', 'as-needed', {
|
|
473
|
+
keywords: false,
|
|
474
|
+
numbers: true,
|
|
475
|
+
unnecessary: true
|
|
476
|
+
}],
|
|
477
|
+
quotes: ['error', 'single', {
|
|
478
|
+
allowTemplateLiterals: false,
|
|
479
|
+
avoidEscape: true
|
|
480
|
+
}],
|
|
481
|
+
radix: ['error', 'as-needed'],
|
|
482
|
+
'require-atomic-updates': 'error',
|
|
483
|
+
'require-await': 'error',
|
|
484
|
+
'require-unicode-regexp': 'error',
|
|
485
|
+
'require-yield': 'off',
|
|
486
|
+
'rest-spread-spacing': ['error', 'never'],
|
|
487
|
+
semi: ['error', 'always', {
|
|
488
|
+
omitLastInOneLineBlock: false
|
|
489
|
+
}],
|
|
490
|
+
'semi-spacing': ['error', {
|
|
491
|
+
after: true,
|
|
492
|
+
before: false
|
|
493
|
+
}],
|
|
494
|
+
'semi-style': ['error', 'last'],
|
|
495
|
+
'sort-imports': 'off',
|
|
496
|
+
'sort-keys': ['error', 'asc', {
|
|
497
|
+
allowLineSeparatedGroups: false,
|
|
498
|
+
caseSensitive: false,
|
|
499
|
+
minKeys: 2,
|
|
500
|
+
natural: true
|
|
501
|
+
}],
|
|
502
|
+
'sort-vars': ['error', {
|
|
503
|
+
ignoreCase: true
|
|
504
|
+
}],
|
|
505
|
+
'space-before-blocks': ['error', 'always'],
|
|
506
|
+
'space-before-function-paren': ['error', {
|
|
507
|
+
anonymous: 'always',
|
|
508
|
+
asyncArrow: 'always',
|
|
509
|
+
named: 'never'
|
|
510
|
+
}],
|
|
511
|
+
'space-in-parens': ['error', 'never'],
|
|
512
|
+
'space-infix-ops': ['error', {
|
|
513
|
+
int32Hint: false
|
|
514
|
+
}],
|
|
515
|
+
'space-unary-ops': ['error', {
|
|
516
|
+
nonwords: false,
|
|
517
|
+
words: true
|
|
518
|
+
}],
|
|
519
|
+
'spaced-comment': ['error', 'always', {
|
|
520
|
+
block: {
|
|
521
|
+
balanced: true,
|
|
522
|
+
exceptions: ['-', '+', '*'],
|
|
523
|
+
markers: ['!', '*']
|
|
524
|
+
},
|
|
525
|
+
line: {
|
|
526
|
+
exceptions: ['-', '+', '*'],
|
|
527
|
+
markers: ['!', '/', '=>']
|
|
528
|
+
}
|
|
529
|
+
}],
|
|
530
|
+
strict: ['error', 'never'],
|
|
531
|
+
'switch-colon-spacing': ['error', {
|
|
532
|
+
after: true,
|
|
533
|
+
before: false
|
|
534
|
+
}],
|
|
535
|
+
'symbol-description': 'error',
|
|
536
|
+
'template-curly-spacing': ['error', 'never'],
|
|
537
|
+
'template-tag-spacing': ['error', 'never'],
|
|
538
|
+
'unicode-bom': ['error', 'never'],
|
|
539
|
+
'use-isnan': ['error', {
|
|
540
|
+
enforceForIndexOf: true,
|
|
541
|
+
enforceForSwitchCase: true
|
|
542
|
+
}],
|
|
543
|
+
'valid-typeof': ['error', {
|
|
544
|
+
requireStringLiterals: false
|
|
545
|
+
}],
|
|
546
|
+
'vars-on-top': 'error',
|
|
547
|
+
'wrap-iife': ['error', 'inside', {
|
|
548
|
+
functionPrototypeMethods: true
|
|
549
|
+
}],
|
|
550
|
+
'wrap-regex': 'off',
|
|
551
|
+
'yield-star-spacing': ['error', 'both'],
|
|
552
|
+
yoda: ['error', 'never'],
|
|
553
|
+
// Plugin: import
|
|
554
|
+
'import/consistent-type-specifier-style': 'off', // TODO: Reconsider if use TS/Flow
|
|
555
|
+
'import/default': 'error',
|
|
556
|
+
'import/dynamic-import-chunkname': ['error'],
|
|
557
|
+
'import/export': 'error',
|
|
558
|
+
'import/exports-last': 'off',
|
|
559
|
+
'import/extensions': 'off',
|
|
560
|
+
'import/first': ['error', 'absolute-first'],
|
|
561
|
+
'import/group-exports': 'off',
|
|
562
|
+
'import/max-dependencies': 'off',
|
|
563
|
+
'import/named': 'error',
|
|
564
|
+
'import/namespace': ['error', {
|
|
565
|
+
allowComputed: false
|
|
566
|
+
}],
|
|
567
|
+
'import/newline-after-import': ['error', {
|
|
568
|
+
considerComments: false,
|
|
569
|
+
count: 1
|
|
570
|
+
}],
|
|
571
|
+
'import/no-absolute-path': ['error', {
|
|
572
|
+
amd: true,
|
|
573
|
+
commonjs: true,
|
|
574
|
+
esmodule: true
|
|
575
|
+
}],
|
|
576
|
+
'import/no-amd': 'off',
|
|
577
|
+
'import/no-anonymous-default-export': 'off',
|
|
578
|
+
'import/no-commonjs': 'off',
|
|
579
|
+
'import/no-cycle': ['error', {
|
|
580
|
+
amd: true,
|
|
581
|
+
commonjs: true,
|
|
582
|
+
esmodule: true, // TODO
|
|
583
|
+
ignoreExternal: true
|
|
584
|
+
}],
|
|
585
|
+
'import/no-default-export': 'off',
|
|
586
|
+
'import/no-deprecated': 'warn',
|
|
587
|
+
'import/no-duplicates': ['error', {
|
|
588
|
+
considerQueryString: true
|
|
589
|
+
}],
|
|
590
|
+
'import/no-dynamic-require': 'off', // TODO
|
|
591
|
+
'import/no-empty-named-blocks': 'error',
|
|
592
|
+
'import/no-extraneous-dependencies': 'error',
|
|
593
|
+
'import/no-import-module-exports': 'off',
|
|
594
|
+
'import/no-internal-modules': 'off',
|
|
595
|
+
'import/no-mutable-exports': 'error',
|
|
596
|
+
'import/no-named-as-default': 'warn',
|
|
597
|
+
'import/no-named-as-default-member': 'error',
|
|
598
|
+
'import/no-named-default': 'off',
|
|
599
|
+
'import/no-named-export': 'off',
|
|
600
|
+
'import/no-namespace': 'off',
|
|
601
|
+
'import/no-nodejs-modules': 'off',
|
|
602
|
+
'import/no-relative-packages': 'off',
|
|
603
|
+
'import/no-relative-parent-imports': 'warn',
|
|
604
|
+
'import/no-restricted-paths': 'off',
|
|
605
|
+
'import/no-self-import': 'error',
|
|
606
|
+
'import/no-unassigned-import': 'off',
|
|
607
|
+
'import/no-unresolved': ['error', {
|
|
608
|
+
ignore: ['^#']
|
|
609
|
+
}],
|
|
610
|
+
'import/no-unused-modules': 'off', // TODO: Reconsider
|
|
611
|
+
'import/no-useless-path-segments': ['error', {
|
|
612
|
+
commonjs: true,
|
|
613
|
+
noUselessIndex: false
|
|
614
|
+
}],
|
|
615
|
+
'import/no-webpack-loader-syntax': 'error',
|
|
616
|
+
// TODO: Improve
|
|
617
|
+
// See: https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md
|
|
618
|
+
'import/order': ['error', {
|
|
619
|
+
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object', 'unknown'],
|
|
620
|
+
'newlines-between': 'always-and-inside-groups',
|
|
621
|
+
alphabetize: {
|
|
622
|
+
caseInsensitive: true,
|
|
623
|
+
order: 'asc'
|
|
624
|
+
}
|
|
625
|
+
}],
|
|
626
|
+
'import/prefer-default-export': 'off',
|
|
627
|
+
'import/unambiguous': 'off' // TODO: Reconsider
|
|
628
|
+
}
|
|
629
|
+
});
|