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