@storm-software/eslint 0.122.8 → 0.123.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.
Files changed (73) hide show
  1. package/README.md +1 -1
  2. package/dist/chunk-7NZUDX62.js +99 -0
  3. package/dist/{chunk-Y67QTC5U.js → chunk-K6KBWFPU.js} +1 -1
  4. package/dist/{chunk-LSG5T3ZK.js → chunk-W6QEP5VE.js} +7 -6
  5. package/dist/chunk-X3L37QNE.js +161 -0
  6. package/dist/preset.d.ts +23 -7048
  7. package/dist/preset.js +3590 -933
  8. package/dist/types-Drnq7vws.d.ts +14859 -0
  9. package/dist/utils/banner-plugin.js +3 -3
  10. package/dist/utils/combine.d.ts +14 -0
  11. package/dist/utils/combine.js +13 -0
  12. package/dist/utils/constants.d.ts +33 -22
  13. package/dist/utils/constants.js +65 -19
  14. package/dist/utils/get-file-banner.js +2 -2
  15. package/dist/utils/helpers.d.ts +55 -0
  16. package/dist/utils/helpers.js +19 -0
  17. package/dist/utils/index.d.ts +1 -1
  18. package/dist/utils/index.js +67 -21
  19. package/package.json +76 -50
  20. package/dist/chunk-723HQUNP.js +0 -14
  21. package/dist/chunk-ESFBJFNU.cjs +0 -149
  22. package/dist/chunk-GMT3V67N.cjs +0 -24
  23. package/dist/chunk-HMBBDY5L.cjs +0 -49
  24. package/dist/chunk-JS7W7LMD.cjs +0 -14
  25. package/dist/chunk-KISSHBCD.cjs +0 -1333
  26. package/dist/chunk-LFHG33FO.cjs +0 -313
  27. package/dist/chunk-QSFZU7HX.cjs +0 -47
  28. package/dist/chunk-RTM5LCEB.js +0 -149
  29. package/dist/chunk-USNT2KNT.cjs +0 -6
  30. package/dist/chunk-VIASOXKK.js +0 -1333
  31. package/dist/preset.cjs +0 -988
  32. package/dist/preset.d.cts +0 -7057
  33. package/dist/rules/import.cjs +0 -291
  34. package/dist/rules/import.d.cts +0 -5
  35. package/dist/rules/import.d.ts +0 -5
  36. package/dist/rules/import.js +0 -291
  37. package/dist/rules/jsx-a11y.cjs +0 -341
  38. package/dist/rules/jsx-a11y.d.cts +0 -5
  39. package/dist/rules/jsx-a11y.d.ts +0 -5
  40. package/dist/rules/jsx-a11y.js +0 -341
  41. package/dist/rules/react-hooks.cjs +0 -15
  42. package/dist/rules/react-hooks.d.cts +0 -5
  43. package/dist/rules/react-hooks.d.ts +0 -5
  44. package/dist/rules/react-hooks.js +0 -15
  45. package/dist/rules/react.cjs +0 -689
  46. package/dist/rules/react.d.cts +0 -5
  47. package/dist/rules/react.d.ts +0 -5
  48. package/dist/rules/react.js +0 -689
  49. package/dist/rules/storm.cjs +0 -7
  50. package/dist/rules/storm.d.cts +0 -11
  51. package/dist/rules/storm.d.ts +0 -11
  52. package/dist/rules/storm.js +0 -7
  53. package/dist/rules/ts-docs.cjs +0 -7
  54. package/dist/rules/ts-docs.d.cts +0 -5
  55. package/dist/rules/ts-docs.d.ts +0 -5
  56. package/dist/rules/ts-docs.js +0 -7
  57. package/dist/rules.d.ts +0 -7005
  58. package/dist/utils/banner-plugin.cjs +0 -9
  59. package/dist/utils/banner-plugin.d.cts +0 -6
  60. package/dist/utils/constants.cjs +0 -25
  61. package/dist/utils/constants.d.cts +0 -24
  62. package/dist/utils/create-flat-import-plugin.cjs +0 -20
  63. package/dist/utils/create-flat-import-plugin.d.cts +0 -11
  64. package/dist/utils/create-flat-import-plugin.d.ts +0 -11
  65. package/dist/utils/create-flat-import-plugin.js +0 -20
  66. package/dist/utils/format-config.cjs +0 -7
  67. package/dist/utils/format-config.d.cts +0 -5
  68. package/dist/utils/get-file-banner.cjs +0 -8
  69. package/dist/utils/get-file-banner.d.cts +0 -9
  70. package/dist/utils/ignores.cjs +0 -7
  71. package/dist/utils/ignores.d.cts +0 -3
  72. package/dist/utils/index.cjs +0 -33
  73. package/dist/utils/index.d.cts +0 -4
@@ -1,1333 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunkUSNT2KNTcjs = require('./chunk-USNT2KNT.cjs');
4
-
5
- // src/rules/storm.ts
6
- var getStormRulesConfig = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (options) => {
7
- let rules = {
8
- /*************************************************************
9
- *
10
- * Base Rules - The core rules that lint for common problems
11
- *
12
- **************************************************************/
13
- /**
14
- * Require return statements in array methods callbacks.
15
- *
16
- * 🚫 Not fixable -https://eslint.org/docs/rules/array-callback-return
17
- */
18
- "array-callback-return": [
19
- "error",
20
- {
21
- allowImplicit: true
22
- }
23
- ],
24
- /**
25
- * Treat `var` statements as if they were block scoped.
26
- *
27
- * 🚫 Not fixable - https://eslint.org/docs/rules/block-scoped-var
28
- */
29
- "block-scoped-var": "error",
30
- /**
31
- * Require curly braces for multiline blocks.
32
- *
33
- * 🔧 Fixable - https://eslint.org/docs/rules/curly
34
- */
35
- curly: [
36
- "warn",
37
- "multi-line"
38
- ],
39
- /**
40
- * Require default clauses in switch statements to be last (if used).
41
- *
42
- * 🚫 Not fixable - https://eslint.org/docs/rules/default-case-last
43
- */
44
- "default-case-last": "error",
45
- /**
46
- * Require triple equals (`===` and `!==`).
47
- *
48
- * 🔧 Fixable - https://eslint.org/docs/rules/eqeqeq
49
- */
50
- eqeqeq: "error",
51
- /**
52
- * Require grouped accessor pairs in object literals and classes.
53
- *
54
- * 🚫 Not fixable - https://eslint.org/docs/rules/grouped-accessor-pairs
55
- */
56
- "grouped-accessor-pairs": "error",
57
- /**
58
- * Disallow use of `alert()`.
59
- *
60
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-alert
61
- */
62
- "no-alert": "error",
63
- /**
64
- * Disallow use of `caller`/`callee`.
65
- *
66
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-caller
67
- */
68
- "no-caller": "error",
69
- /**
70
- * Disallow returning value in constructor.
71
- *
72
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-constructor-return
73
- */
74
- "no-constructor-return": "error",
75
- /**
76
- * Disallow using an `else` if the `if` block contains a return.
77
- *
78
- * 🔧 Fixable - https://eslint.org/docs/rules/no-else-return
79
- */
80
- "no-else-return": "warn",
81
- /**
82
- * Disallow `eval()`.
83
- *
84
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-eval
85
- */
86
- "no-eval": "warn",
87
- /**
88
- * Disallow extending native objects.
89
- *
90
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-extend-native
91
- */
92
- "no-extend-native": "error",
93
- /**
94
- * Disallow unnecessary function binding.
95
- *
96
- * 🔧 Fixable - https://eslint.org/docs/rules/no-extra-bind
97
- */
98
- "no-extra-bind": "error",
99
- /**
100
- * Disallow unnecessary labels.
101
- *
102
- * 🔧 Fixable - https://eslint.org/docs/rules/no-extra-label
103
- */
104
- "no-extra-label": "error",
105
- /**
106
- * Disallow floating decimals.
107
- *
108
- * 🔧 Fixable - https://eslint.org/docs/rules/no-floating-decimal
109
- */
110
- "no-floating-decimal": "error",
111
- /**
112
- * Make people convert types explicitly e.g. `Boolean(foo)` instead of `!!foo`.
113
- *
114
- * 🔧 Partially Fixable - https://eslint.org/docs/rules/no-implicit-coercion
115
- */
116
- "no-implicit-coercion": "error",
117
- /**
118
- * Disallow use of `eval()`-like methods.
119
- *
120
- * https://eslint.org/docs/rules/no-implied-eval
121
- */
122
- "no-implied-eval": "error",
123
- /**
124
- * Disallow usage of `__iterator__` property.
125
- *
126
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-iterator
127
- */
128
- "no-iterator": "error",
129
- /**
130
- * Disallow use of labels for anything other than loops and switches.
131
- *
132
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-labels
133
- */
134
- "no-labels": [
135
- "error"
136
- ],
137
- /**
138
- * Disallow unnecessary nested blocks.
139
- *
140
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-lone-blocks
141
- */
142
- "no-lone-blocks": "error",
143
- /**
144
- * Disallow `new` for side effects.
145
- *
146
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-new
147
- */
148
- "no-new": "error",
149
- /**
150
- * Disallow function constructors.
151
- *
152
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-new-func
153
- */
154
- "no-new-func": "error",
155
- /**
156
- * Disallow base types wrapper instances, such as `new String('foo')`.
157
- *
158
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-new-wrappers
159
- */
160
- "no-new-wrappers": "error",
161
- /**
162
- * Disallow use of octal escape sequences in string literals.
163
- *
164
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-octal-escape
165
- */
166
- "no-octal-escape": "error",
167
- /**
168
- * Disallow reassignment of function parameters.
169
- *
170
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-param-reassign
171
- */
172
- "no-param-reassign": "off",
173
- /**
174
- * Disallow usage of the deprecated `__proto__` property.
175
- *
176
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-proto
177
- */
178
- "no-proto": "error",
179
- /**
180
- * Disallow assignment in `return` statement.
181
- *
182
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-return-assign
183
- */
184
- "no-return-assign": "error",
185
- /**
186
- * Disallows unnecessary `return await`.
187
- *
188
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-return-await
189
- */
190
- "no-return-await": "error",
191
- /**
192
- * Disallow use of `javascript:` urls.
193
- *
194
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-script-url
195
- */
196
- "no-script-url": "error",
197
- /**
198
- * Disallow comparisons where both sides are exactly the same.
199
- *
200
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-self-compare
201
- */
202
- "no-self-compare": "error",
203
- /**
204
- * Disallow use of comma operator.
205
- *
206
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-sequences
207
- */
208
- "no-sequences": "error",
209
- /**
210
- * Disallow unnecessary `.call()` and `.apply()`.
211
- *
212
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-useless-call
213
- */
214
- "no-useless-call": "error",
215
- /**
216
- * Disallow unnecessary concatenation of strings.
217
- *
218
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-useless-concat
219
- */
220
- "no-useless-concat": "error",
221
- /**
222
- * Disallow redundant return statements.
223
- *
224
- * 🔧 Fixable - https://eslint.org/docs/rules/no-useless-return
225
- */
226
- "no-useless-return": "warn",
227
- /**
228
- * Require using named capture groups in regular expressions.
229
- *
230
- * 🚫 Not fixable - https://eslint.org/docs/rules/prefer-named-capture-group
231
- */
232
- "prefer-named-capture-group": "off",
233
- /**
234
- * Require using Error objects as Promise rejection reasons.
235
- *
236
- * 🚫 Not fixable - https://eslint.org/docs/rules/prefer-promise-reject-errors
237
- */
238
- "prefer-promise-reject-errors": [
239
- "error",
240
- {
241
- allowEmptyReject: true
242
- }
243
- ],
244
- /**
245
- * Disallow use of the RegExp constructor in favor of regular expression
246
- * literals.
247
- *
248
- * 🚫 Not fixable - https://eslint.org/docs/rules/prefer-regex-literals
249
- */
250
- "prefer-regex-literals": "error",
251
- /**
252
- * Disallow "Yoda conditions", ensuring the comparison.
253
- *
254
- * 🔧 Fixable - https://eslint.org/docs/rules/yoda
255
- */
256
- yoda: "warn",
257
- // Enforce “for” loop update clause moving the counter in the right direction
258
- // https://eslint.org/docs/rules/for-direction
259
- "for-direction": "error",
260
- // Enforces that a return statement is present in property getters
261
- // https://eslint.org/docs/rules/getter-return
262
- "getter-return": [
263
- "error",
264
- {
265
- allowImplicit: true
266
- }
267
- ],
268
- // disallow using an async function as a Promise executor
269
- // https://eslint.org/docs/rules/no-async-promise-executor
270
- "no-async-promise-executor": "error",
271
- // Disallow await inside of loops
272
- // https://eslint.org/docs/rules/no-await-in-loop
273
- "no-await-in-loop": "error",
274
- // Disallow comparisons to negative zero
275
- // https://eslint.org/docs/rules/no-compare-neg-zero
276
- "no-compare-neg-zero": "error",
277
- // disallow assignment in conditional expressions
278
- "no-cond-assign": [
279
- "error",
280
- "always"
281
- ],
282
- // disallow use of console
283
- "no-console": "error",
284
- // Disallows expressions where the operation doesn't affect the value
285
- // https://eslint.org/docs/rules/no-constant-binary-expression
286
- // TODO: semver-major, enable
287
- "no-constant-binary-expression": "off",
288
- // disallow use of constant expressions in conditions
289
- "no-constant-condition": "warn",
290
- // disallow control characters in regular expressions
291
- "no-control-regex": "error",
292
- // disallow use of debugger
293
- "no-debugger": "warn",
294
- // disallow duplicate arguments in functions
295
- "no-dupe-args": "error",
296
- // Disallow duplicate conditions in if-else-if chains
297
- // https://eslint.org/docs/rules/no-dupe-else-if
298
- "no-dupe-else-if": "error",
299
- // disallow duplicate keys when creating object literals
300
- "no-dupe-keys": "error",
301
- // disallow a duplicate case label.
302
- "no-duplicate-case": "error",
303
- // disallow empty statements
304
- "no-empty": "error",
305
- // disallow the use of empty character classes in regular expressions
306
- "no-empty-character-class": "error",
307
- // disallow assigning to the exception in a catch block
308
- "no-ex-assign": "error",
309
- // disallow double-negation boolean casts in a boolean context
310
- // https://eslint.org/docs/rules/no-extra-boolean-cast
311
- "no-extra-boolean-cast": "error",
312
- // disallow unnecessary parentheses
313
- // https://eslint.org/docs/rules/no-extra-parens
314
- "no-extra-parens": [
315
- "off",
316
- "all",
317
- {
318
- conditionalAssign: true,
319
- nestedBinaryExpressions: false,
320
- returnAssign: false,
321
- ignoreJSX: "all",
322
- enforceForArrowConditionals: false
323
- }
324
- ],
325
- // disallow unnecessary semicolons
326
- "no-extra-semi": "error",
327
- // disallow overwriting functions written as function declarations
328
- "no-func-assign": "off",
329
- // https://eslint.org/docs/rules/no-import-assign
330
- "no-import-assign": "error",
331
- // disallow function or variable declarations in nested blocks
332
- "no-inner-declarations": "warn",
333
- // disallow invalid regular expression strings in the RegExp constructor
334
- "no-invalid-regexp": "error",
335
- // disallow irregular whitespace outside of strings and comments
336
- "no-irregular-whitespace": "error",
337
- // Disallow Number Literals That Lose Precision
338
- // https://eslint.org/docs/rules/no-loss-of-precision
339
- "no-loss-of-precision": "error",
340
- // Disallow characters which are made with multiple code points in character class syntax
341
- // https://eslint.org/docs/rules/no-misleading-character-class
342
- "no-misleading-character-class": "error",
343
- // disallow the use of object properties of the global object (Math and JSON) as functions
344
- "no-obj-calls": "error",
345
- // Disallow new operators with global non-constructor functions
346
- // https://eslint.org/docs/latest/rules/no-new-native-nonconstructor
347
- // TODO: semver-major, enable
348
- "no-new-native-nonconstructor": "off",
349
- // Disallow returning values from Promise executor functions
350
- // https://eslint.org/docs/rules/no-promise-executor-return
351
- "no-promise-executor-return": "error",
352
- // disallow use of Object.prototypes builtins directly
353
- // https://eslint.org/docs/rules/no-prototype-builtins
354
- "no-prototype-builtins": "error",
355
- // disallow multiple spaces in a regular expression literal
356
- "no-regex-spaces": "error",
357
- // Disallow returning values from setters
358
- // https://eslint.org/docs/rules/no-setter-return
359
- "no-setter-return": "error",
360
- // disallow sparse arrays
361
- "no-sparse-arrays": "error",
362
- // Disallow template literal placeholder syntax in regular strings
363
- // https://eslint.org/docs/rules/no-template-curly-in-string
364
- "no-template-curly-in-string": "error",
365
- // Avoid code that looks like two expressions but is actually one
366
- // https://eslint.org/docs/rules/no-unexpected-multiline
367
- "no-unexpected-multiline": "error",
368
- // disallow unreachable statements after a return, throw, continue, or break statement
369
- "no-unreachable": "error",
370
- // Disallow loops with a body that allows only one iteration
371
- // https://eslint.org/docs/rules/no-unreachable-loop
372
- "no-unreachable-loop": [
373
- "error",
374
- {
375
- ignore: []
376
- }
377
- ],
378
- // disallow return/throw/break/continue inside finally blocks
379
- // https://eslint.org/docs/rules/no-unsafe-finally
380
- "no-unsafe-finally": "error",
381
- // disallow negating the left operand of relational operators
382
- // https://eslint.org/docs/rules/no-unsafe-negation
383
- "no-unsafe-negation": "error",
384
- // disallow use of optional chaining in contexts where the undefined value is not allowed
385
- // https://eslint.org/docs/rules/no-unsafe-optional-chaining
386
- "no-unsafe-optional-chaining": [
387
- "error",
388
- {
389
- disallowArithmeticOperators: true
390
- }
391
- ],
392
- // Disallow Unused Private Class Members
393
- // https://eslint.org/docs/rules/no-unused-private-class-members
394
- // TODO: enable once eslint 7 is dropped (which is semver-major)
395
- "no-unused-private-class-members": "off",
396
- // Disallow useless backreferences in regular expressions
397
- // https://eslint.org/docs/rules/no-useless-backreference
398
- "no-useless-backreference": "error",
399
- // disallow negation of the left operand of an in expression
400
- // deprecated in favor of no-unsafe-negation
401
- "no-negated-in-lhs": "off",
402
- // Disallow assignments that can lead to race conditions due to usage of await or yield
403
- // https://eslint.org/docs/rules/require-atomic-updates
404
- // note: not enabled because it is very buggy
405
- "require-atomic-updates": "off",
406
- // disallow comparisons with the value NaN
407
- "use-isnan": "error",
408
- // ensure JSDoc comments are valid
409
- // https://eslint.org/docs/rules/valid-jsdoc
410
- "valid-jsdoc": "off",
411
- // ensure that the results of typeof are compared against a valid string
412
- // https://eslint.org/docs/rules/valid-typeof
413
- "valid-typeof": [
414
- "error",
415
- {
416
- requireStringLiterals: true
417
- }
418
- ],
419
- /*************************************************************
420
- *
421
- * Stylistic Rules - These rules relate to style guidelines
422
- *
423
- **************************************************************/
424
- // enforce line breaks after opening and before closing array brackets
425
- // https://eslint.org/docs/rules/array-bracket-newline
426
- // TODO: enable? semver-major
427
- "array-bracket-newline": [
428
- "off",
429
- "consistent"
430
- ],
431
- // enforce line breaks between array elements
432
- // https://eslint.org/docs/rules/array-element-newline
433
- // TODO: enable? semver-major
434
- "array-element-newline": [
435
- "off",
436
- {
437
- multiline: true,
438
- minItems: 3
439
- }
440
- ],
441
- // enforce spacing inside array brackets
442
- "array-bracket-spacing": [
443
- "error",
444
- "never"
445
- ],
446
- // enforce spacing inside single-line blocks
447
- // https://eslint.org/docs/rules/block-spacing
448
- "block-spacing": [
449
- "error",
450
- "always"
451
- ],
452
- // enforce one true brace style
453
- "brace-style": [
454
- "error",
455
- "1tbs",
456
- {
457
- allowSingleLine: true
458
- }
459
- ],
460
- // require camel case names
461
- camelcase: [
462
- "error",
463
- {
464
- properties: "never",
465
- ignoreDestructuring: false
466
- }
467
- ],
468
- // enforce or disallow capitalization of the first letter of a comment
469
- // https://eslint.org/docs/rules/capitalized-comments
470
- "capitalized-comments": [
471
- "off",
472
- "never",
473
- {
474
- line: {
475
- ignorePattern: ".*",
476
- ignoreInlineComments: true,
477
- ignoreConsecutiveComments: true
478
- },
479
- block: {
480
- ignorePattern: ".*",
481
- ignoreInlineComments: true,
482
- ignoreConsecutiveComments: true
483
- }
484
- }
485
- ],
486
- // require trailing commas in multiline object literals
487
- "comma-dangle": [
488
- "error",
489
- "never"
490
- ],
491
- // enforce spacing before and after comma
492
- "comma-spacing": [
493
- "error",
494
- {
495
- before: false,
496
- after: true
497
- }
498
- ],
499
- // enforce one true comma style
500
- "comma-style": [
501
- "error",
502
- "last",
503
- {
504
- exceptions: {
505
- ArrayExpression: false,
506
- ArrayPattern: false,
507
- ArrowFunctionExpression: false,
508
- CallExpression: false,
509
- FunctionDeclaration: false,
510
- FunctionExpression: false,
511
- ImportDeclaration: false,
512
- ObjectExpression: false,
513
- ObjectPattern: false,
514
- VariableDeclaration: false,
515
- NewExpression: false
516
- }
517
- }
518
- ],
519
- // disallow padding inside computed properties
520
- "computed-property-spacing": [
521
- "error",
522
- "never"
523
- ],
524
- // enforces consistent naming when capturing the current execution context
525
- "consistent-this": "off",
526
- // enforce newline at the end of file, with no multiple empty lines
527
- "eol-last": [
528
- "error",
529
- "always"
530
- ],
531
- // https://eslint.org/docs/rules/function-call-argument-newline
532
- "function-call-argument-newline": [
533
- "error",
534
- "consistent"
535
- ],
536
- // enforce spacing between functions and their invocations
537
- // https://eslint.org/docs/rules/func-call-spacing
538
- "func-call-spacing": [
539
- "error",
540
- "never"
541
- ],
542
- // requires function names to match the name of the variable or property to which they are
543
- // assigned
544
- // https://eslint.org/docs/rules/func-name-matching
545
- "func-name-matching": [
546
- "off",
547
- "always",
548
- {
549
- includeCommonJSModuleExports: false,
550
- considerPropertyDescriptor: true
551
- }
552
- ],
553
- // require function expressions to have a name
554
- // https://eslint.org/docs/rules/func-names
555
- "func-names": "warn",
556
- // enforces use of function declarations or expressions
557
- // https://eslint.org/docs/rules/func-style
558
- // TODO: enable
559
- "func-style": [
560
- "off",
561
- "expression"
562
- ],
563
- // require line breaks inside function parentheses if there are line breaks between parameters
564
- // https://eslint.org/docs/rules/function-paren-newline
565
- "function-paren-newline": "off",
566
- // disallow specified identifiers
567
- // https://eslint.org/docs/rules/id-denylist
568
- "id-denylist": "off",
569
- // this option enforces minimum and maximum identifier lengths
570
- // (variable names, property names etc.)
571
- "id-length": "off",
572
- // require identifiers to match the provided regular expression
573
- "id-match": "off",
574
- // Enforce the location of arrow function bodies with implicit returns
575
- // https://eslint.org/docs/rules/implicit-arrow-linebreak
576
- "implicit-arrow-linebreak": "off",
577
- // this option sets a specific tab width for your code
578
- // https://eslint.org/docs/rules/indent
579
- indent: "off",
580
- // "error",
581
- // 2,
582
- // {
583
- // SwitchCase: 1,
584
- // VariableDeclarator: 1,
585
- // outerIIFEBody: 1,
586
- // // MemberExpression: null,
587
- // FunctionDeclaration: {
588
- // parameters: 1,
589
- // body: 1
590
- // },
591
- // FunctionExpression: {
592
- // parameters: 1,
593
- // body: 1
594
- // },
595
- // CallExpression: {
596
- // arguments: 1
597
- // },
598
- // ArrayExpression: 1,
599
- // ObjectExpression: 1,
600
- // ImportDeclaration: 1,
601
- // flatTernaryExpressions: false,
602
- // // list derived from https://github.com/benjamn/ast-types/blob/HEAD/def/jsx.js
603
- // ignoredNodes: [
604
- // "JSXElement",
605
- // "JSXElement > *",
606
- // "JSXAttribute",
607
- // "JSXIdentifier",
608
- // "JSXNamespacedName",
609
- // "JSXMemberExpression",
610
- // "JSXSpreadAttribute",
611
- // "JSXExpressionContainer",
612
- // "JSXOpeningElement",
613
- // "JSXClosingElement",
614
- // "JSXFragment",
615
- // "JSXOpeningFragment",
616
- // "JSXClosingFragment",
617
- // "JSXText",
618
- // "JSXEmptyExpression",
619
- // "JSXSpreadChild"
620
- // ],
621
- // ignoreComments: false
622
- // }
623
- // ],
624
- // specify whether double or single quotes should be used in JSX attributes
625
- // https://eslint.org/docs/rules/jsx-quotes
626
- "jsx-quotes": [
627
- "off",
628
- "prefer-double"
629
- ],
630
- // enforces spacing between keys and values in object literal properties
631
- "key-spacing": [
632
- "error",
633
- {
634
- beforeColon: false,
635
- afterColon: true
636
- }
637
- ],
638
- // require a space before & after certain keywords
639
- "keyword-spacing": [
640
- "error",
641
- {
642
- before: true,
643
- after: true,
644
- overrides: {
645
- return: {
646
- after: true
647
- },
648
- throw: {
649
- after: true
650
- },
651
- case: {
652
- after: true
653
- }
654
- }
655
- }
656
- ],
657
- // enforce position of line comments
658
- // https://eslint.org/docs/rules/line-comment-position
659
- // TODO: enable?
660
- "line-comment-position": [
661
- "off",
662
- {
663
- position: "above",
664
- ignorePattern: "",
665
- applyDefaultPatterns: true
666
- }
667
- ],
668
- // disallow mixed 'LF' and 'CRLF' as linebreaks
669
- // https://eslint.org/docs/rules/linebreak-style
670
- "linebreak-style": [
671
- "error",
672
- "unix"
673
- ],
674
- // require or disallow an empty line between class members
675
- // https://eslint.org/docs/rules/lines-between-class-members
676
- "lines-between-class-members": [
677
- "error",
678
- "always",
679
- {
680
- exceptAfterSingleLine: false
681
- }
682
- ],
683
- // enforces empty lines around comments
684
- "lines-around-comment": "off",
685
- // require or disallow newlines around directives
686
- // https://eslint.org/docs/rules/lines-around-directive
687
- "lines-around-directive": [
688
- "error",
689
- {
690
- before: "always",
691
- after: "always"
692
- }
693
- ],
694
- // Require or disallow logical assignment logical operator shorthand
695
- // https://eslint.org/docs/latest/rules/logical-assignment-operators
696
- // TODO, semver-major: enable
697
- "logical-assignment-operators": [
698
- "off",
699
- "always",
700
- {
701
- enforceForIfStatements: true
702
- }
703
- ],
704
- // specify the maximum depth that blocks can be nested
705
- "max-depth": [
706
- "off",
707
- 4
708
- ],
709
- // specify the maximum length of a line in your program
710
- // https://eslint.org/docs/rules/max-len
711
- "max-len": [
712
- "error",
713
- 100,
714
- 2,
715
- {
716
- ignoreUrls: true,
717
- ignoreComments: true,
718
- ignoreRegExpLiterals: true,
719
- ignoreStrings: true,
720
- ignoreTemplateLiterals: true
721
- }
722
- ],
723
- // specify the max number of lines in a file
724
- // https://eslint.org/docs/rules/max-lines
725
- "max-lines": [
726
- "off",
727
- {
728
- max: 300,
729
- skipBlankLines: true,
730
- skipComments: true
731
- }
732
- ],
733
- // enforce a maximum function length
734
- // https://eslint.org/docs/rules/max-lines-per-function
735
- "max-lines-per-function": [
736
- "off",
737
- {
738
- max: 50,
739
- skipBlankLines: true,
740
- skipComments: true,
741
- IIFEs: true
742
- }
743
- ],
744
- // specify the maximum depth callbacks can be nested
745
- "max-nested-callbacks": "off",
746
- // limits the number of parameters that can be used in the function declaration.
747
- "max-params": [
748
- "off",
749
- 3
750
- ],
751
- // specify the maximum number of statement allowed in a function
752
- "max-statements": [
753
- "off",
754
- 10
755
- ],
756
- // restrict the number of statements per line
757
- // https://eslint.org/docs/rules/max-statements-per-line
758
- "max-statements-per-line": [
759
- "off",
760
- {
761
- max: 1
762
- }
763
- ],
764
- // enforce a particular style for multiline comments
765
- // https://eslint.org/docs/rules/multiline-comment-style
766
- "multiline-comment-style": [
767
- "off",
768
- "starred-block"
769
- ],
770
- // require multiline ternary
771
- // https://eslint.org/docs/rules/multiline-ternary
772
- // TODO: enable?
773
- "multiline-ternary": [
774
- "off",
775
- "never"
776
- ],
777
- // require a capital letter for constructors
778
- "new-cap": [
779
- "error",
780
- {
781
- newIsCap: true,
782
- newIsCapExceptions: [],
783
- capIsNew: false,
784
- capIsNewExceptions: [
785
- "Immutable.Map",
786
- "Immutable.Set",
787
- "Immutable.List"
788
- ]
789
- }
790
- ],
791
- "no-unused-vars": [
792
- "error",
793
- {
794
- args: "none"
795
- }
796
- ],
797
- // disallow the omission of parentheses when invoking a constructor with no arguments
798
- // https://eslint.org/docs/rules/new-parens
799
- "new-parens": "error",
800
- // allow/disallow an empty newline after var statement
801
- "newline-after-var": "off",
802
- // Require or disallow padding lines between statements
803
- // https://eslint.org/docs/rules/padding-line-between-statements
804
- "padding-line-between-statements": [
805
- "error",
806
- {
807
- blankLine: "always",
808
- prev: [
809
- "const",
810
- "let",
811
- "var"
812
- ],
813
- next: "return"
814
- }
815
- ],
816
- // enforces new line after each method call in the chain to make it
817
- // more readable and easy to maintain
818
- // https://eslint.org/docs/rules/newline-per-chained-call
819
- "newline-per-chained-call": [
820
- "error",
821
- {
822
- ignoreChainWithDepth: 5
823
- }
824
- ],
825
- // disallow use of the Array constructor
826
- "no-array-constructor": "error",
827
- // disallow use of bitwise operators
828
- // https://eslint.org/docs/rules/no-bitwise
829
- "no-bitwise": "off",
830
- // disallow use of the continue statement
831
- // https://eslint.org/docs/rules/no-continue
832
- "no-continue": "off",
833
- // disallow comments inline after code
834
- "no-inline-comments": "off",
835
- // disallow if as the only statement in an else block
836
- // https://eslint.org/docs/rules/no-lonely-if
837
- "no-lonely-if": "error",
838
- // disallow un-paren'd mixes of different operators
839
- // https://eslint.org/docs/rules/no-mixed-operators
840
- "no-mixed-operators": [
841
- "error",
842
- {
843
- // the list of arithmetic groups disallows mixing `%` and `**`
844
- // with other arithmetic operators.
845
- groups: [
846
- [
847
- "%",
848
- "**"
849
- ],
850
- [
851
- "%",
852
- "+"
853
- ],
854
- [
855
- "%",
856
- "-"
857
- ],
858
- [
859
- "%",
860
- "*"
861
- ],
862
- [
863
- "%",
864
- "/"
865
- ],
866
- [
867
- "/",
868
- "*"
869
- ],
870
- [
871
- "&",
872
- "|",
873
- "<<",
874
- ">>",
875
- ">>>"
876
- ],
877
- [
878
- "==",
879
- "!=",
880
- "===",
881
- "!=="
882
- ],
883
- [
884
- "&&",
885
- "||"
886
- ]
887
- ],
888
- allowSamePrecedence: false
889
- }
890
- ],
891
- // disallow mixed spaces and tabs for indentation
892
- "no-mixed-spaces-and-tabs": "error",
893
- // disallow use of chained assignment expressions
894
- // https://eslint.org/docs/rules/no-multi-assign
895
- "no-multi-assign": [
896
- "error"
897
- ],
898
- // disallow multiple empty lines, only one newline at the end, and no new lines at the beginning
899
- // https://eslint.org/docs/rules/no-multiple-empty-lines
900
- "no-multiple-empty-lines": [
901
- "error",
902
- {
903
- max: 1,
904
- maxBOF: 0,
905
- maxEOF: 0
906
- }
907
- ],
908
- // disallow negated conditions
909
- // https://eslint.org/docs/rules/no-negated-condition
910
- "no-negated-condition": "off",
911
- // disallow nested ternary expressions
912
- "no-nested-ternary": "off",
913
- // disallow use of the Object constructor
914
- "no-new-object": "error",
915
- // disallow use of unary operators, ++ and --
916
- // https://eslint.org/docs/rules/no-plusplus
917
- "no-plusplus": "off",
918
- // disallow certain syntax forms
919
- // https://eslint.org/docs/rules/no-restricted-syntax
920
- "no-restricted-syntax": [
921
- "error",
922
- // {
923
- // selector: "ForInStatement",
924
- // message:
925
- // "for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array."
926
- // },
927
- // {
928
- // selector: "ForOfStatement",
929
- // message:
930
- // "iterators/generators require regenerator-runtime, which is too heavyweight for this guide to allow them. Separately, loops should be avoided in favor of array iterations."
931
- // },
932
- {
933
- selector: "LabeledStatement",
934
- message: "Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand."
935
- },
936
- {
937
- selector: "WithStatement",
938
- message: "`with` is disallowed in strict mode because it makes code impossible to predict and optimize."
939
- }
940
- ],
941
- // disallow space between function identifier and application
942
- // deprecated in favor of func-call-spacing
943
- "no-spaced-func": "off",
944
- // disallow tab characters entirely
945
- "no-tabs": "error",
946
- // disallow the use of ternary operators
947
- "no-ternary": "off",
948
- // disallow trailing whitespace at the end of lines
949
- "no-trailing-spaces": [
950
- "error",
951
- {
952
- skipBlankLines: false,
953
- ignoreComments: false
954
- }
955
- ],
956
- // disallow dangling underscores in identifiers
957
- // https://eslint.org/docs/rules/no-underscore-dangle
958
- "no-underscore-dangle": [
959
- "off",
960
- {
961
- allow: [],
962
- allowAfterThis: false,
963
- allowAfterSuper: false,
964
- enforceInMethodNames: true
965
- }
966
- ],
967
- // disallow the use of Boolean literals in conditional expressions
968
- // also, prefer `a || b` over `a ? a : b`
969
- // https://eslint.org/docs/rules/no-unneeded-ternary
970
- "no-unneeded-ternary": [
971
- "error",
972
- {
973
- defaultAssignment: false
974
- }
975
- ],
976
- // disallow whitespace before properties
977
- // https://eslint.org/docs/rules/no-whitespace-before-property
978
- "no-whitespace-before-property": "error",
979
- // enforce the location of single-line statements
980
- // https://eslint.org/docs/rules/nonblock-statement-body-position
981
- "nonblock-statement-body-position": [
982
- "error",
983
- "beside",
984
- {
985
- overrides: {}
986
- }
987
- ],
988
- // require padding inside curly braces
989
- "object-curly-spacing": [
990
- "error",
991
- "always"
992
- ],
993
- // enforce line breaks between braces
994
- // https://eslint.org/docs/rules/object-curly-newline
995
- "object-curly-newline": [
996
- "error",
997
- {
998
- ObjectExpression: {
999
- minProperties: 5,
1000
- multiline: true,
1001
- consistent: true
1002
- },
1003
- ObjectPattern: {
1004
- minProperties: 5,
1005
- multiline: true,
1006
- consistent: true
1007
- },
1008
- ImportDeclaration: {
1009
- minProperties: 5,
1010
- multiline: true,
1011
- consistent: true
1012
- },
1013
- ExportDeclaration: {
1014
- minProperties: 5,
1015
- multiline: true,
1016
- consistent: true
1017
- }
1018
- }
1019
- ],
1020
- // enforce "same line" or "multiple line" on object properties.
1021
- // https://eslint.org/docs/rules/object-property-newline
1022
- "object-property-newline": [
1023
- "error",
1024
- {
1025
- allowAllPropertiesOnSameLine: false
1026
- }
1027
- ],
1028
- // allow just one var statement per function
1029
- "one-var": [
1030
- "error",
1031
- "never"
1032
- ],
1033
- // require a newline around variable declaration
1034
- // https://eslint.org/docs/rules/one-var-declaration-per-line
1035
- "one-var-declaration-per-line": [
1036
- "error",
1037
- "always"
1038
- ],
1039
- // require assignment operator shorthand where possible or prohibit it entirely
1040
- // https://eslint.org/docs/rules/operator-assignment
1041
- "operator-assignment": [
1042
- "error",
1043
- "always"
1044
- ],
1045
- // Requires operator at the beginning of the line in multiline statements
1046
- // https://eslint.org/docs/rules/operator-linebreak
1047
- "operator-linebreak": [
1048
- "error",
1049
- "after",
1050
- {
1051
- overrides: {
1052
- "=": "none"
1053
- }
1054
- }
1055
- ],
1056
- // disallow padding within blocks
1057
- "padded-blocks": [
1058
- "error",
1059
- {
1060
- blocks: "never",
1061
- classes: "never",
1062
- switches: "never"
1063
- },
1064
- {
1065
- allowSingleLineBlocks: true
1066
- }
1067
- ],
1068
- // Disallow the use of Math.pow in favor of the ** operator
1069
- // https://eslint.org/docs/rules/prefer-exponentiation-operator
1070
- "prefer-exponentiation-operator": "error",
1071
- // Prefer use of an object spread over Object.assign
1072
- // https://eslint.org/docs/rules/prefer-object-spread
1073
- "prefer-object-spread": "error",
1074
- // require quotes around object literal property names
1075
- // https://eslint.org/docs/rules/quote-props.html
1076
- "quote-props": [
1077
- "error",
1078
- "as-needed",
1079
- {
1080
- keywords: false,
1081
- unnecessary: true,
1082
- numbers: false
1083
- }
1084
- ],
1085
- // specify whether double or single quotes should be used
1086
- quotes: [
1087
- "error",
1088
- "double",
1089
- {
1090
- avoidEscape: true
1091
- }
1092
- ],
1093
- // do not require jsdoc
1094
- // https://eslint.org/docs/rules/require-jsdoc
1095
- "require-jsdoc": "off",
1096
- // require or disallow use of semicolons instead of ASI
1097
- semi: [
1098
- "error",
1099
- "always"
1100
- ],
1101
- // enforce spacing before and after semicolons
1102
- "semi-spacing": [
1103
- "error",
1104
- {
1105
- before: false,
1106
- after: true
1107
- }
1108
- ],
1109
- // Enforce location of semicolons
1110
- // https://eslint.org/docs/rules/semi-style
1111
- "semi-style": [
1112
- "error",
1113
- "last"
1114
- ],
1115
- // requires object keys to be sorted
1116
- "sort-keys": [
1117
- "off",
1118
- "asc",
1119
- {
1120
- caseSensitive: false,
1121
- natural: true
1122
- }
1123
- ],
1124
- // sort variables within the same declaration block
1125
- "sort-vars": "off",
1126
- // require or disallow space before blocks
1127
- "space-before-blocks": "error",
1128
- // require or disallow space before function opening parenthesis
1129
- // https://eslint.org/docs/rules/space-before-function-paren
1130
- "space-before-function-paren": "off",
1131
- // "error",
1132
- // {
1133
- // anonymous: "always",
1134
- // named: "never",
1135
- // asyncArrow: "always"
1136
- // }
1137
- // ],
1138
- // require or disallow spaces inside parentheses
1139
- "space-in-parens": [
1140
- "error",
1141
- "never"
1142
- ],
1143
- // require spaces around operators
1144
- "space-infix-ops": "error",
1145
- // Require or disallow spaces before/after unary operators
1146
- // https://eslint.org/docs/rules/space-unary-ops
1147
- "space-unary-ops": [
1148
- "error",
1149
- {
1150
- words: true,
1151
- nonwords: false,
1152
- overrides: {}
1153
- }
1154
- ],
1155
- // require or disallow a space immediately following the // or /* in a comment
1156
- // https://eslint.org/docs/rules/spaced-comment
1157
- "spaced-comment": [
1158
- "error",
1159
- "always",
1160
- {
1161
- line: {
1162
- exceptions: [
1163
- "-",
1164
- "+"
1165
- ],
1166
- markers: [
1167
- "=",
1168
- "!",
1169
- "/"
1170
- ]
1171
- },
1172
- block: {
1173
- exceptions: [
1174
- "-",
1175
- "+"
1176
- ],
1177
- markers: [
1178
- "=",
1179
- "!",
1180
- ":",
1181
- "::"
1182
- ],
1183
- balanced: true
1184
- }
1185
- }
1186
- ],
1187
- // Enforce spacing around colons of switch statements
1188
- // https://eslint.org/docs/rules/switch-colon-spacing
1189
- "switch-colon-spacing": [
1190
- "error",
1191
- {
1192
- after: true,
1193
- before: false
1194
- }
1195
- ],
1196
- // Require or disallow spacing between template tags and their literals
1197
- // https://eslint.org/docs/rules/template-tag-spacing
1198
- "template-tag-spacing": [
1199
- "error",
1200
- "never"
1201
- ],
1202
- // require or disallow the Unicode Byte Order Mark
1203
- // https://eslint.org/docs/rules/unicode-bom
1204
- "unicode-bom": [
1205
- "error",
1206
- "never"
1207
- ],
1208
- // require regex literals to be wrapped in parentheses
1209
- "wrap-regex": "off",
1210
- "class-methods-use-this": "off"
1211
- };
1212
- if (options.typescriptEslintConfigType !== "none") {
1213
- rules = {
1214
- ...rules,
1215
- /*************************************************************
1216
- *
1217
- * TypeScript Rules - The following rules are specific to the TypeScript plugin
1218
- *
1219
- **************************************************************/
1220
- "@typescript-eslint/no-explicit-any": "off",
1221
- "@typescript-eslint/no-empty-function": "off",
1222
- "@typescript-eslint/no-var-requires": "off",
1223
- "@typescript-eslint/ban-ts-comment": "off",
1224
- "@typescript-eslint/no-empty-interface": "off",
1225
- "@typescript-eslint/explicit-module-boundary-types": "off",
1226
- "@typescript-eslint/explicit-function-return-type": "off",
1227
- "@typescript-eslint/no-unused-vars": [
1228
- "error",
1229
- {
1230
- args: "none",
1231
- varsIgnorePattern: "^_"
1232
- }
1233
- ],
1234
- "@typescript-eslint/prefer-nullish-coalescing": [
1235
- "error",
1236
- {
1237
- ignorePrimitives: {
1238
- string: true
1239
- }
1240
- }
1241
- ],
1242
- "@typescript-eslint/no-restricted-imports": [
1243
- "error",
1244
- {
1245
- patterns: [
1246
- {
1247
- group: [
1248
- "nx/src/plugins/js*"
1249
- ],
1250
- message: "Imports from 'nx/src/plugins/js' are not allowed. Use '@nx/js' instead"
1251
- },
1252
- {
1253
- group: [
1254
- "**/native-bindings",
1255
- "**/native-bindings.js"
1256
- ],
1257
- message: "Direct imports from native-bindings.js are not allowed. Import from index.js instead."
1258
- },
1259
- {
1260
- group: [
1261
- "create-storm-workspace"
1262
- ],
1263
- message: "Direct imports from `create-storm-workspace` are not allowed. Instead install this package globally (example: 'npm i create-storm-workspace -g')."
1264
- },
1265
- {
1266
- group: [
1267
- "create-nx-workspace"
1268
- ],
1269
- message: "Direct imports from `create-nx-workspace` are not allowed. Instead install this package globally (example: 'npm i create-nx-workspace -g')."
1270
- }
1271
- ]
1272
- }
1273
- ]
1274
- };
1275
- }
1276
- if (options.useNx !== false) {
1277
- rules = {
1278
- ...rules,
1279
- /*************************************************************
1280
- *
1281
- * Nx Rules - The following rules are specific to the Nx plugin
1282
- *
1283
- **************************************************************/
1284
- "@nx/enforce-module-boundaries": [
1285
- "error",
1286
- {
1287
- enforceBuildableLibDependency: true,
1288
- checkDynamicDependenciesExceptions: [
1289
- ".*"
1290
- ],
1291
- allow: [],
1292
- depConstraints: [
1293
- {
1294
- sourceTag: "*",
1295
- onlyDependOnLibsWithTags: [
1296
- "*"
1297
- ]
1298
- }
1299
- ]
1300
- }
1301
- ]
1302
- };
1303
- }
1304
- if (options.useUnicorn !== false) {
1305
- rules = {
1306
- ...rules,
1307
- /*************************************************************
1308
- *
1309
- * Unicorn Rules - The following rules are specific to the Unicorn plugin
1310
- *
1311
- **************************************************************/
1312
- "unicorn/number-literal-case": "off",
1313
- "unicorn/template-indent": "off",
1314
- "unicorn/prevent-abbreviations": "off",
1315
- "unicorn/no-await-expression-member": "off",
1316
- "unicorn/no-useless-undefined": "off",
1317
- "unicorn/no-array-push-push": "off",
1318
- "unicorn/no-array-reduce": "off",
1319
- "unicorn/no-useless-switch-case": "off",
1320
- "unicorn/prefer-string-replace-all": "off",
1321
- "unicorn/no-abusive-eslint-disable": "off",
1322
- "unicorn/import-style": "off",
1323
- "unicorn/prefer-module": "off",
1324
- "unicorn/consistent-function-scoping": "off",
1325
- "unicorn/no-nested-ternary": "off"
1326
- };
1327
- }
1328
- return rules;
1329
- }, "getStormRulesConfig");
1330
-
1331
-
1332
-
1333
- exports.getStormRulesConfig = getStormRulesConfig;