@lumelabs/eslint-config 0.1.0 → 0.2.0
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 +95 -34
- package/index.cjs +97 -55
- package/package.json +19 -8
- package/rules/errors.js +1 -5
- package/rules/imports.js +10 -5
- package/rules/react-hooks.js +68 -5
- package/rules/react.js +5 -100
- package/rules/style.js +14 -541
- package/override.js +0 -4
- package/rules/node.js +0 -39
package/rules/style.js
CHANGED
|
@@ -1,315 +1,11 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
+
// Pure formatting rules used to live here, but Prettier owns formatting and
|
|
3
|
+
// eslint-config-prettier turns every one of them off anyway. Only the
|
|
4
|
+
// non-formatting (code-convention) rules remain.
|
|
2
5
|
rules: {
|
|
3
|
-
//
|
|
4
|
-
// https://eslint.org/docs/rules/array-bracket-newline
|
|
5
|
-
// TODO: enable? semver-major
|
|
6
|
-
"array-bracket-newline": ["off", "consistent"], // object option alternative: { multiline: true, minItems: 3 }
|
|
7
|
-
|
|
8
|
-
// enforce line breaks between array elements
|
|
9
|
-
// https://eslint.org/docs/rules/array-element-newline
|
|
10
|
-
// TODO: enable? semver-major
|
|
11
|
-
"array-element-newline": ["off", { multiline: true, minItems: 3 }],
|
|
12
|
-
|
|
13
|
-
// enforce spacing inside array brackets
|
|
14
|
-
"array-bracket-spacing": ["error", "never"],
|
|
15
|
-
|
|
16
|
-
// enforce spacing inside single-line blocks
|
|
17
|
-
// https://eslint.org/docs/rules/block-spacing
|
|
18
|
-
"block-spacing": ["error", "always"],
|
|
19
|
-
|
|
20
|
-
// enforce one true brace style
|
|
21
|
-
"brace-style": ["error", "1tbs", { allowSingleLine: true }],
|
|
22
|
-
|
|
23
|
-
// require camel case names
|
|
6
|
+
// require camelCase names
|
|
24
7
|
camelcase: ["error", { properties: "never", ignoreDestructuring: false }],
|
|
25
8
|
|
|
26
|
-
// enforce or disallow capitalization of the first letter of a comment
|
|
27
|
-
// https://eslint.org/docs/rules/capitalized-comments
|
|
28
|
-
"capitalized-comments": [
|
|
29
|
-
"off",
|
|
30
|
-
"never",
|
|
31
|
-
{
|
|
32
|
-
line: {
|
|
33
|
-
ignorePattern: ".*",
|
|
34
|
-
ignoreInlineComments: true,
|
|
35
|
-
ignoreConsecutiveComments: true,
|
|
36
|
-
},
|
|
37
|
-
block: {
|
|
38
|
-
ignorePattern: ".*",
|
|
39
|
-
ignoreInlineComments: true,
|
|
40
|
-
ignoreConsecutiveComments: true,
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
],
|
|
44
|
-
|
|
45
|
-
// require trailing commas in multiline object literals
|
|
46
|
-
"comma-dangle": [
|
|
47
|
-
"error",
|
|
48
|
-
{
|
|
49
|
-
arrays: "always-multiline",
|
|
50
|
-
objects: "always-multiline",
|
|
51
|
-
imports: "always-multiline",
|
|
52
|
-
exports: "always-multiline",
|
|
53
|
-
functions: "always-multiline",
|
|
54
|
-
},
|
|
55
|
-
],
|
|
56
|
-
|
|
57
|
-
// enforce spacing before and after comma
|
|
58
|
-
"comma-spacing": ["error", { before: false, after: true }],
|
|
59
|
-
|
|
60
|
-
// enforce one true comma style
|
|
61
|
-
"comma-style": [
|
|
62
|
-
"error",
|
|
63
|
-
"last",
|
|
64
|
-
{
|
|
65
|
-
exceptions: {
|
|
66
|
-
ArrayExpression: false,
|
|
67
|
-
ArrayPattern: false,
|
|
68
|
-
ArrowFunctionExpression: false,
|
|
69
|
-
CallExpression: false,
|
|
70
|
-
FunctionDeclaration: false,
|
|
71
|
-
FunctionExpression: false,
|
|
72
|
-
ImportDeclaration: false,
|
|
73
|
-
ObjectExpression: false,
|
|
74
|
-
ObjectPattern: false,
|
|
75
|
-
VariableDeclaration: false,
|
|
76
|
-
NewExpression: false,
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
],
|
|
80
|
-
|
|
81
|
-
// disallow padding inside computed properties
|
|
82
|
-
"computed-property-spacing": ["error", "never"],
|
|
83
|
-
|
|
84
|
-
// enforces consistent naming when capturing the current execution context
|
|
85
|
-
"consistent-this": "off",
|
|
86
|
-
|
|
87
|
-
// enforce newline at the end of file, with no multiple empty lines
|
|
88
|
-
"eol-last": ["error", "always"],
|
|
89
|
-
|
|
90
|
-
// https://eslint.org/docs/rules/function-call-argument-newline
|
|
91
|
-
"function-call-argument-newline": ["error", "consistent"],
|
|
92
|
-
|
|
93
|
-
// enforce spacing between functions and their invocations
|
|
94
|
-
// https://eslint.org/docs/rules/func-call-spacing
|
|
95
|
-
"func-call-spacing": ["error", "never"],
|
|
96
|
-
|
|
97
|
-
// requires function names to match the name of the variable or property to which they are
|
|
98
|
-
// assigned
|
|
99
|
-
// https://eslint.org/docs/rules/func-name-matching
|
|
100
|
-
"func-name-matching": [
|
|
101
|
-
"off",
|
|
102
|
-
"always",
|
|
103
|
-
{
|
|
104
|
-
includeCommonJSModuleExports: false,
|
|
105
|
-
considerPropertyDescriptor: true,
|
|
106
|
-
},
|
|
107
|
-
],
|
|
108
|
-
|
|
109
|
-
// require function expressions to have a name
|
|
110
|
-
// https://eslint.org/docs/rules/func-names
|
|
111
|
-
"func-names": "warn",
|
|
112
|
-
|
|
113
|
-
// enforces use of function declarations or expressions
|
|
114
|
-
// https://eslint.org/docs/rules/func-style
|
|
115
|
-
// TODO: enable
|
|
116
|
-
"func-style": ["off", "expression"],
|
|
117
|
-
|
|
118
|
-
// require line breaks inside function parentheses if there are line breaks between parameters
|
|
119
|
-
// https://eslint.org/docs/rules/function-paren-newline
|
|
120
|
-
"function-paren-newline": ["error", "multiline-arguments"],
|
|
121
|
-
|
|
122
|
-
// disallow specified identifiers
|
|
123
|
-
// https://eslint.org/docs/rules/id-denylist
|
|
124
|
-
"id-denylist": "off",
|
|
125
|
-
|
|
126
|
-
// this option enforces minimum and maximum identifier lengths
|
|
127
|
-
// (variable names, property names etc.)
|
|
128
|
-
"id-length": "off",
|
|
129
|
-
|
|
130
|
-
// require identifiers to match the provided regular expression
|
|
131
|
-
"id-match": "off",
|
|
132
|
-
|
|
133
|
-
// Enforce the location of arrow function bodies with implicit returns
|
|
134
|
-
// https://eslint.org/docs/rules/implicit-arrow-linebreak
|
|
135
|
-
"implicit-arrow-linebreak": ["error", "beside"],
|
|
136
|
-
|
|
137
|
-
// this option sets a specific tab width for your code
|
|
138
|
-
// https://eslint.org/docs/rules/indent
|
|
139
|
-
indent: [
|
|
140
|
-
"error",
|
|
141
|
-
2,
|
|
142
|
-
{
|
|
143
|
-
SwitchCase: 1,
|
|
144
|
-
VariableDeclarator: 1,
|
|
145
|
-
outerIIFEBody: 1,
|
|
146
|
-
// MemberExpression: null,
|
|
147
|
-
FunctionDeclaration: {
|
|
148
|
-
parameters: 1,
|
|
149
|
-
body: 1,
|
|
150
|
-
},
|
|
151
|
-
FunctionExpression: {
|
|
152
|
-
parameters: 1,
|
|
153
|
-
body: 1,
|
|
154
|
-
},
|
|
155
|
-
CallExpression: {
|
|
156
|
-
arguments: 1,
|
|
157
|
-
},
|
|
158
|
-
ArrayExpression: 1,
|
|
159
|
-
ObjectExpression: 1,
|
|
160
|
-
ImportDeclaration: 1,
|
|
161
|
-
flatTernaryExpressions: false,
|
|
162
|
-
// list derived from https://github.com/benjamn/ast-types/blob/HEAD/def/jsx.js
|
|
163
|
-
ignoredNodes: [
|
|
164
|
-
"JSXElement",
|
|
165
|
-
"JSXElement > *",
|
|
166
|
-
"JSXAttribute",
|
|
167
|
-
"JSXIdentifier",
|
|
168
|
-
"JSXNamespacedName",
|
|
169
|
-
"JSXMemberExpression",
|
|
170
|
-
"JSXSpreadAttribute",
|
|
171
|
-
"JSXExpressionContainer",
|
|
172
|
-
"JSXOpeningElement",
|
|
173
|
-
"JSXClosingElement",
|
|
174
|
-
"JSXFragment",
|
|
175
|
-
"JSXOpeningFragment",
|
|
176
|
-
"JSXClosingFragment",
|
|
177
|
-
"JSXText",
|
|
178
|
-
"JSXEmptyExpression",
|
|
179
|
-
"JSXSpreadChild",
|
|
180
|
-
],
|
|
181
|
-
ignoreComments: false,
|
|
182
|
-
},
|
|
183
|
-
],
|
|
184
|
-
|
|
185
|
-
// specify whether double or single quotes should be used in JSX attributes
|
|
186
|
-
// https://eslint.org/docs/rules/jsx-quotes
|
|
187
|
-
"jsx-quotes": ["off", "prefer-double"],
|
|
188
|
-
|
|
189
|
-
// enforces spacing between keys and values in object literal properties
|
|
190
|
-
"key-spacing": ["error", { beforeColon: false, afterColon: true }],
|
|
191
|
-
|
|
192
|
-
// require a space before & after certain keywords
|
|
193
|
-
"keyword-spacing": [
|
|
194
|
-
"error",
|
|
195
|
-
{
|
|
196
|
-
before: true,
|
|
197
|
-
after: true,
|
|
198
|
-
overrides: {
|
|
199
|
-
return: { after: true },
|
|
200
|
-
throw: { after: true },
|
|
201
|
-
case: { after: true },
|
|
202
|
-
},
|
|
203
|
-
},
|
|
204
|
-
],
|
|
205
|
-
|
|
206
|
-
// enforce position of line comments
|
|
207
|
-
// https://eslint.org/docs/rules/line-comment-position
|
|
208
|
-
// TODO: enable?
|
|
209
|
-
"line-comment-position": [
|
|
210
|
-
"off",
|
|
211
|
-
{
|
|
212
|
-
position: "above",
|
|
213
|
-
ignorePattern: "",
|
|
214
|
-
applyDefaultPatterns: true,
|
|
215
|
-
},
|
|
216
|
-
],
|
|
217
|
-
|
|
218
|
-
// disallow mixed 'LF' and 'CRLF' as linebreaks
|
|
219
|
-
// https://eslint.org/docs/rules/linebreak-style
|
|
220
|
-
"linebreak-style": ["error", "unix"],
|
|
221
|
-
|
|
222
|
-
// require or disallow an empty line between class members
|
|
223
|
-
// https://eslint.org/docs/rules/lines-between-class-members
|
|
224
|
-
"lines-between-class-members": "off",
|
|
225
|
-
|
|
226
|
-
// enforces empty lines around comments
|
|
227
|
-
"lines-around-comment": "off",
|
|
228
|
-
|
|
229
|
-
// require or disallow newlines around directives
|
|
230
|
-
// https://eslint.org/docs/rules/lines-around-directive
|
|
231
|
-
"lines-around-directive": [
|
|
232
|
-
"error",
|
|
233
|
-
{
|
|
234
|
-
before: "always",
|
|
235
|
-
after: "always",
|
|
236
|
-
},
|
|
237
|
-
],
|
|
238
|
-
|
|
239
|
-
// Require or disallow logical assignment logical operator shorthand
|
|
240
|
-
// https://eslint.org/docs/latest/rules/logical-assignment-operators
|
|
241
|
-
// TODO, semver-major: enable
|
|
242
|
-
"logical-assignment-operators": [
|
|
243
|
-
"off",
|
|
244
|
-
"always",
|
|
245
|
-
{
|
|
246
|
-
enforceForIfStatements: true,
|
|
247
|
-
},
|
|
248
|
-
],
|
|
249
|
-
|
|
250
|
-
// specify the maximum depth that blocks can be nested
|
|
251
|
-
"max-depth": ["off", 4],
|
|
252
|
-
|
|
253
|
-
// specify the maximum length of a line in your program
|
|
254
|
-
// https://eslint.org/docs/rules/max-len
|
|
255
|
-
"max-len": [
|
|
256
|
-
"error",
|
|
257
|
-
100,
|
|
258
|
-
2,
|
|
259
|
-
{
|
|
260
|
-
ignoreUrls: true,
|
|
261
|
-
ignoreComments: false,
|
|
262
|
-
ignoreRegExpLiterals: true,
|
|
263
|
-
ignoreStrings: true,
|
|
264
|
-
ignoreTemplateLiterals: true,
|
|
265
|
-
},
|
|
266
|
-
],
|
|
267
|
-
|
|
268
|
-
// specify the max number of lines in a file
|
|
269
|
-
// https://eslint.org/docs/rules/max-lines
|
|
270
|
-
"max-lines": [
|
|
271
|
-
"off",
|
|
272
|
-
{
|
|
273
|
-
max: 300,
|
|
274
|
-
skipBlankLines: true,
|
|
275
|
-
skipComments: true,
|
|
276
|
-
},
|
|
277
|
-
],
|
|
278
|
-
|
|
279
|
-
// enforce a maximum function length
|
|
280
|
-
// https://eslint.org/docs/rules/max-lines-per-function
|
|
281
|
-
"max-lines-per-function": [
|
|
282
|
-
"off",
|
|
283
|
-
{
|
|
284
|
-
max: 50,
|
|
285
|
-
skipBlankLines: true,
|
|
286
|
-
skipComments: true,
|
|
287
|
-
IIFEs: true,
|
|
288
|
-
},
|
|
289
|
-
],
|
|
290
|
-
|
|
291
|
-
// specify the maximum depth callbacks can be nested
|
|
292
|
-
"max-nested-callbacks": "off",
|
|
293
|
-
|
|
294
|
-
// limits the number of parameters that can be used in the function declaration.
|
|
295
|
-
"max-params": ["off", 3],
|
|
296
|
-
|
|
297
|
-
// specify the maximum number of statement allowed in a function
|
|
298
|
-
"max-statements": ["off", 10],
|
|
299
|
-
|
|
300
|
-
// restrict the number of statements per line
|
|
301
|
-
// https://eslint.org/docs/rules/max-statements-per-line
|
|
302
|
-
"max-statements-per-line": ["off", { max: 1 }],
|
|
303
|
-
|
|
304
|
-
// enforce a particular style for multiline comments
|
|
305
|
-
// https://eslint.org/docs/rules/multiline-comment-style
|
|
306
|
-
"multiline-comment-style": ["off", "starred-block"],
|
|
307
|
-
|
|
308
|
-
// require multiline ternary
|
|
309
|
-
// https://eslint.org/docs/rules/multiline-ternary
|
|
310
|
-
// TODO: enable?
|
|
311
|
-
"multiline-ternary": ["off", "never"],
|
|
312
|
-
|
|
313
9
|
// require a capital letter for constructors
|
|
314
10
|
"new-cap": [
|
|
315
11
|
"error",
|
|
@@ -321,86 +17,12 @@ module.exports = {
|
|
|
321
17
|
},
|
|
322
18
|
],
|
|
323
19
|
|
|
324
|
-
// disallow the omission of parentheses when invoking a constructor with no arguments
|
|
325
|
-
// https://eslint.org/docs/rules/new-parens
|
|
326
|
-
"new-parens": "error",
|
|
327
|
-
|
|
328
|
-
// allow/disallow an empty newline after var statement
|
|
329
|
-
"newline-after-var": "off",
|
|
330
|
-
|
|
331
|
-
// https://eslint.org/docs/rules/newline-before-return
|
|
332
|
-
"newline-before-return": "off",
|
|
333
|
-
|
|
334
|
-
// enforces new line after each method call in the chain to make it
|
|
335
|
-
// more readable and easy to maintain
|
|
336
|
-
// https://eslint.org/docs/rules/newline-per-chained-call
|
|
337
|
-
"newline-per-chained-call": ["error", { ignoreChainWithDepth: 4 }],
|
|
338
|
-
|
|
339
20
|
// disallow use of the Array constructor
|
|
340
21
|
"no-array-constructor": "error",
|
|
341
22
|
|
|
342
|
-
// disallow use of bitwise operators
|
|
343
|
-
// https://eslint.org/docs/rules/no-bitwise
|
|
344
|
-
"no-bitwise": "off",
|
|
345
|
-
|
|
346
|
-
// disallow use of the continue statement
|
|
347
|
-
// https://eslint.org/docs/rules/no-continue
|
|
348
|
-
"no-continue": "off",
|
|
349
|
-
|
|
350
|
-
// disallow comments inline after code
|
|
351
|
-
"no-inline-comments": "off",
|
|
352
|
-
|
|
353
|
-
// disallow if as the only statement in an else block
|
|
354
|
-
// https://eslint.org/docs/rules/no-lonely-if
|
|
355
|
-
"no-lonely-if": "off",
|
|
356
|
-
|
|
357
|
-
// disallow un-paren'd mixes of different operators
|
|
358
|
-
// https://eslint.org/docs/rules/no-mixed-operators
|
|
359
|
-
"no-mixed-operators": [
|
|
360
|
-
"error",
|
|
361
|
-
{
|
|
362
|
-
// the list of arithmetic groups disallows mixing `%` and `**`
|
|
363
|
-
// with other arithmetic operators.
|
|
364
|
-
groups: [
|
|
365
|
-
["%", "**"],
|
|
366
|
-
["%", "+"],
|
|
367
|
-
["%", "-"],
|
|
368
|
-
["%", "*"],
|
|
369
|
-
["%", "/"],
|
|
370
|
-
["/", "*"],
|
|
371
|
-
["&", "|", "<<", ">>", ">>>"],
|
|
372
|
-
["==", "!=", "===", "!=="],
|
|
373
|
-
["&&", "||"],
|
|
374
|
-
],
|
|
375
|
-
allowSamePrecedence: false,
|
|
376
|
-
},
|
|
377
|
-
],
|
|
378
|
-
|
|
379
|
-
// disallow mixed spaces and tabs for indentation
|
|
380
|
-
"no-mixed-spaces-and-tabs": "error",
|
|
381
|
-
|
|
382
|
-
// disallow use of chained assignment expressions
|
|
383
|
-
// https://eslint.org/docs/rules/no-multi-assign
|
|
384
|
-
"no-multi-assign": "off",
|
|
385
|
-
|
|
386
|
-
// disallow multiple empty lines, only one newline at the end, and no new lines at the beginning
|
|
387
|
-
// https://eslint.org/docs/rules/no-multiple-empty-lines
|
|
388
|
-
"no-multiple-empty-lines": ["error", { max: 1, maxBOF: 0, maxEOF: 0 }],
|
|
389
|
-
|
|
390
|
-
// disallow negated conditions
|
|
391
|
-
// https://eslint.org/docs/rules/no-negated-condition
|
|
392
|
-
"no-negated-condition": "off",
|
|
393
|
-
|
|
394
|
-
// disallow nested ternary expressions
|
|
395
|
-
"no-nested-ternary": "off",
|
|
396
|
-
|
|
397
23
|
// disallow use of the Object constructor
|
|
398
24
|
"no-new-object": "error",
|
|
399
25
|
|
|
400
|
-
// disallow use of unary operators, ++ and --
|
|
401
|
-
// https://eslint.org/docs/rules/no-plusplus
|
|
402
|
-
"no-plusplus": "off",
|
|
403
|
-
|
|
404
26
|
// disallow certain syntax forms
|
|
405
27
|
// https://eslint.org/docs/rules/no-restricted-syntax
|
|
406
28
|
"no-restricted-syntax": [
|
|
@@ -422,165 +44,31 @@ module.exports = {
|
|
|
422
44
|
},
|
|
423
45
|
],
|
|
424
46
|
|
|
425
|
-
// disallow
|
|
426
|
-
// deprecated in favor of func-call-spacing
|
|
427
|
-
"no-spaced-func": "off",
|
|
428
|
-
|
|
429
|
-
// disallow tab characters entirely
|
|
430
|
-
"no-tabs": "error",
|
|
431
|
-
|
|
432
|
-
// disallow the use of ternary operators
|
|
433
|
-
"no-ternary": "off",
|
|
434
|
-
|
|
435
|
-
// disallow trailing whitespace at the end of lines
|
|
436
|
-
"no-trailing-spaces": [
|
|
437
|
-
"error",
|
|
438
|
-
{
|
|
439
|
-
skipBlankLines: false,
|
|
440
|
-
ignoreComments: false,
|
|
441
|
-
},
|
|
442
|
-
],
|
|
443
|
-
|
|
444
|
-
// disallow dangling underscores in identifiers
|
|
445
|
-
// https://eslint.org/docs/rules/no-underscore-dangle
|
|
446
|
-
"no-underscore-dangle": "off",
|
|
447
|
-
|
|
448
|
-
// disallow the use of Boolean literals in conditional expressions
|
|
449
|
-
// also, prefer `a || b` over `a ? a : b`
|
|
47
|
+
// disallow ternary operators when simpler alternatives exist
|
|
450
48
|
// https://eslint.org/docs/rules/no-unneeded-ternary
|
|
451
49
|
"no-unneeded-ternary": ["error", { defaultAssignment: false }],
|
|
452
50
|
|
|
453
|
-
//
|
|
454
|
-
// https://eslint.org/docs/rules/no-whitespace-before-property
|
|
455
|
-
"no-whitespace-before-property": "error",
|
|
456
|
-
|
|
457
|
-
// enforce the location of single-line statements
|
|
458
|
-
// https://eslint.org/docs/rules/nonblock-statement-body-position
|
|
459
|
-
"nonblock-statement-body-position": ["error", "beside", { overrides: {} }],
|
|
460
|
-
|
|
461
|
-
// require padding inside curly braces
|
|
462
|
-
"object-curly-spacing": ["error", "always"],
|
|
463
|
-
|
|
464
|
-
// enforce line breaks between braces
|
|
465
|
-
// https://eslint.org/docs/rules/object-curly-newline
|
|
466
|
-
"object-curly-newline": [
|
|
467
|
-
"error",
|
|
468
|
-
{
|
|
469
|
-
ObjectExpression: { minProperties: 4, multiline: true, consistent: true },
|
|
470
|
-
ObjectPattern: { minProperties: 4, multiline: true, consistent: true },
|
|
471
|
-
ImportDeclaration: { minProperties: 4, multiline: true, consistent: true },
|
|
472
|
-
ExportDeclaration: { minProperties: 4, multiline: true, consistent: true },
|
|
473
|
-
},
|
|
474
|
-
],
|
|
475
|
-
|
|
476
|
-
// enforce "same line" or "multiple line" on object properties.
|
|
477
|
-
// https://eslint.org/docs/rules/object-property-newline
|
|
478
|
-
"object-property-newline": [
|
|
479
|
-
"error",
|
|
480
|
-
{
|
|
481
|
-
allowAllPropertiesOnSameLine: true,
|
|
482
|
-
},
|
|
483
|
-
],
|
|
484
|
-
|
|
485
|
-
// allow just one var statement per function
|
|
51
|
+
// require one declaration per variable statement
|
|
486
52
|
"one-var": ["error", "never"],
|
|
487
53
|
|
|
488
|
-
// require
|
|
489
|
-
// https://eslint.org/docs/rules/one-var-declaration-per-line
|
|
490
|
-
"one-var-declaration-per-line": ["error", "always"],
|
|
491
|
-
|
|
492
|
-
// require assignment operator shorthand where possible or prohibit it entirely
|
|
54
|
+
// require assignment operator shorthand where possible
|
|
493
55
|
// https://eslint.org/docs/rules/operator-assignment
|
|
494
56
|
"operator-assignment": ["error", "always"],
|
|
495
57
|
|
|
496
|
-
//
|
|
497
|
-
// https://eslint.org/docs/rules/operator-linebreak
|
|
498
|
-
"operator-linebreak": ["error", "before", { overrides: { "=": "none" } }],
|
|
499
|
-
|
|
500
|
-
// disallow padding within blocks
|
|
501
|
-
"padded-blocks": [
|
|
502
|
-
"error",
|
|
503
|
-
{
|
|
504
|
-
blocks: "never",
|
|
505
|
-
classes: "never",
|
|
506
|
-
switches: "never",
|
|
507
|
-
},
|
|
508
|
-
{
|
|
509
|
-
allowSingleLineBlocks: true,
|
|
510
|
-
},
|
|
511
|
-
],
|
|
512
|
-
|
|
513
|
-
// Require or disallow padding lines between statements
|
|
514
|
-
// https://eslint.org/docs/rules/padding-line-between-statements
|
|
515
|
-
"padding-line-between-statements": "off",
|
|
516
|
-
|
|
517
|
-
// Disallow the use of Math.pow in favor of the ** operator
|
|
58
|
+
// disallow Math.pow in favor of the ** operator
|
|
518
59
|
// https://eslint.org/docs/rules/prefer-exponentiation-operator
|
|
519
60
|
"prefer-exponentiation-operator": "error",
|
|
520
61
|
|
|
521
|
-
//
|
|
62
|
+
// prefer object spread over Object.assign
|
|
522
63
|
// https://eslint.org/docs/rules/prefer-object-spread
|
|
523
64
|
"prefer-object-spread": "error",
|
|
524
65
|
|
|
525
|
-
// require
|
|
526
|
-
// https://eslint.org/docs/rules/
|
|
527
|
-
"
|
|
528
|
-
|
|
529
|
-
// specify whether double or single quotes should be used
|
|
530
|
-
quotes: ["error", "single", { avoidEscape: true }],
|
|
531
|
-
|
|
532
|
-
// do not require jsdoc
|
|
533
|
-
// https://eslint.org/docs/rules/require-jsdoc
|
|
534
|
-
"require-jsdoc": "off",
|
|
535
|
-
|
|
536
|
-
// require or disallow use of semicolons instead of ASI
|
|
537
|
-
semi: ["error", "always"],
|
|
538
|
-
|
|
539
|
-
// enforce spacing before and after semicolons
|
|
540
|
-
"semi-spacing": ["error", { before: false, after: true }],
|
|
541
|
-
|
|
542
|
-
// Enforce location of semicolons
|
|
543
|
-
// https://eslint.org/docs/rules/semi-style
|
|
544
|
-
"semi-style": ["error", "last"],
|
|
545
|
-
|
|
546
|
-
// requires object keys to be sorted
|
|
547
|
-
"sort-keys": ["off", "asc", { caseSensitive: false, natural: true }],
|
|
548
|
-
|
|
549
|
-
// sort variables within the same declaration block
|
|
550
|
-
"sort-vars": "off",
|
|
551
|
-
|
|
552
|
-
// require or disallow space before blocks
|
|
553
|
-
"space-before-blocks": "error",
|
|
554
|
-
|
|
555
|
-
// require or disallow space before function opening parenthesis
|
|
556
|
-
// https://eslint.org/docs/rules/space-before-function-paren
|
|
557
|
-
"space-before-function-paren": [
|
|
558
|
-
"error",
|
|
559
|
-
{
|
|
560
|
-
anonymous: "always",
|
|
561
|
-
named: "never",
|
|
562
|
-
asyncArrow: "always",
|
|
563
|
-
},
|
|
564
|
-
],
|
|
565
|
-
|
|
566
|
-
// require or disallow spaces inside parentheses
|
|
567
|
-
"space-in-parens": ["error", "never"],
|
|
568
|
-
|
|
569
|
-
// require spaces around operators
|
|
570
|
-
"space-infix-ops": "error",
|
|
571
|
-
|
|
572
|
-
// Require or disallow spaces before/after unary operators
|
|
573
|
-
// https://eslint.org/docs/rules/space-unary-ops
|
|
574
|
-
"space-unary-ops": [
|
|
575
|
-
"error",
|
|
576
|
-
{
|
|
577
|
-
words: true,
|
|
578
|
-
nonwords: false,
|
|
579
|
-
overrides: {},
|
|
580
|
-
},
|
|
581
|
-
],
|
|
66
|
+
// require function expressions to have a name
|
|
67
|
+
// https://eslint.org/docs/rules/func-names
|
|
68
|
+
"func-names": "warn",
|
|
582
69
|
|
|
583
|
-
// require
|
|
70
|
+
// require a space after // or /* in a comment
|
|
71
|
+
// (not a Prettier concern — Prettier never reformats comment bodies)
|
|
584
72
|
// https://eslint.org/docs/rules/spaced-comment
|
|
585
73
|
"spaced-comment": [
|
|
586
74
|
"error",
|
|
@@ -597,20 +85,5 @@ module.exports = {
|
|
|
597
85
|
},
|
|
598
86
|
},
|
|
599
87
|
],
|
|
600
|
-
|
|
601
|
-
// Enforce spacing around colons of switch statements
|
|
602
|
-
// https://eslint.org/docs/rules/switch-colon-spacing
|
|
603
|
-
"switch-colon-spacing": ["error", { after: true, before: false }],
|
|
604
|
-
|
|
605
|
-
// Require or disallow spacing between template tags and their literals
|
|
606
|
-
// https://eslint.org/docs/rules/template-tag-spacing
|
|
607
|
-
"template-tag-spacing": ["error", "never"],
|
|
608
|
-
|
|
609
|
-
// require or disallow the Unicode Byte Order Mark
|
|
610
|
-
// https://eslint.org/docs/rules/unicode-bom
|
|
611
|
-
"unicode-bom": ["error", "never"],
|
|
612
|
-
|
|
613
|
-
// require regex literals to be wrapped in parentheses
|
|
614
|
-
"wrap-regex": "off",
|
|
615
88
|
},
|
|
616
89
|
}
|
package/override.js
DELETED
package/rules/node.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
rules: {
|
|
3
|
-
// enforce return after a callback
|
|
4
|
-
"callback-return": "off",
|
|
5
|
-
|
|
6
|
-
// require all requires be top-level
|
|
7
|
-
// https://eslint.org/docs/rules/global-require
|
|
8
|
-
"global-require": "error",
|
|
9
|
-
|
|
10
|
-
// enforces error handling in callbacks (node environment)
|
|
11
|
-
"handle-callback-err": "off",
|
|
12
|
-
|
|
13
|
-
// disallow use of the Buffer() constructor
|
|
14
|
-
// https://eslint.org/docs/rules/no-buffer-constructor
|
|
15
|
-
"no-buffer-constructor": "error",
|
|
16
|
-
|
|
17
|
-
// disallow mixing regular variable and require declarations
|
|
18
|
-
"no-mixed-requires": ["off", false],
|
|
19
|
-
|
|
20
|
-
// disallow use of new operator with the require function
|
|
21
|
-
"no-new-require": "error",
|
|
22
|
-
|
|
23
|
-
// disallow string concatenation with __dirname and __filename
|
|
24
|
-
// https://eslint.org/docs/rules/no-path-concat
|
|
25
|
-
"no-path-concat": "error",
|
|
26
|
-
|
|
27
|
-
// disallow use of process.env
|
|
28
|
-
"no-process-env": "off",
|
|
29
|
-
|
|
30
|
-
// disallow process.exit()
|
|
31
|
-
"no-process-exit": "off",
|
|
32
|
-
|
|
33
|
-
// restrict usage of specified node modules
|
|
34
|
-
"no-restricted-modules": "off",
|
|
35
|
-
|
|
36
|
-
// disallow use of synchronous methods (off by default)
|
|
37
|
-
"no-sync": "off",
|
|
38
|
-
},
|
|
39
|
-
}
|