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