@eslinted/defaults 12.10.0 → 12.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/.github/workflows/RELEASE.yml +36 -36
  2. package/.github/workflows/rc.yml +36 -36
  3. package/.markdownlint.jsonc +97 -97
  4. package/.mocharc.yml +15 -15
  5. package/LICENSE +20 -20
  6. package/README.md +4 -4
  7. package/dist/index.d.ts +99 -912
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/rules/index.d.ts +99 -492
  10. package/dist/rules/index.d.ts.map +1 -1
  11. package/dist/rules/scopes/enable.d.ts +0 -2
  12. package/dist/rules/scopes/enable.d.ts.map +1 -1
  13. package/dist/rules/scopes/enable.js +0 -3
  14. package/dist/rules/scopes/enable.js.map +1 -1
  15. package/dist/rules/scopes/enable.style.d.ts +24 -134
  16. package/dist/rules/scopes/enable.style.d.ts.map +1 -1
  17. package/dist/rules/scopes/enable.style.js +22 -192
  18. package/dist/rules/scopes/enable.style.js.map +1 -1
  19. package/dist/rules/scopes/index.d.ts +24 -136
  20. package/dist/rules/scopes/index.d.ts.map +1 -1
  21. package/dist/rules/scopes/json/index.d.ts +7 -20
  22. package/dist/rules/scopes/json/index.d.ts.map +1 -1
  23. package/dist/rules/scopes/json/plugin/extension.d.ts +7 -20
  24. package/dist/rules/scopes/json/plugin/extension.d.ts.map +1 -1
  25. package/dist/rules/scopes/json/plugin/extension.js +7 -41
  26. package/dist/rules/scopes/json/plugin/extension.js.map +1 -1
  27. package/dist/rules/scopes/mocha/chai/index.d.ts +0 -2
  28. package/dist/rules/scopes/mocha/chai/index.d.ts.map +1 -1
  29. package/dist/rules/scopes/mocha/chai/index.js +0 -2
  30. package/dist/rules/scopes/mocha/chai/index.js.map +1 -1
  31. package/dist/rules/scopes/mocha/enable.d.ts +3 -10
  32. package/dist/rules/scopes/mocha/enable.d.ts.map +1 -1
  33. package/dist/rules/scopes/mocha/enable.js +3 -19
  34. package/dist/rules/scopes/mocha/enable.js.map +1 -1
  35. package/dist/rules/scopes/mocha/index.d.ts +3 -12
  36. package/dist/rules/scopes/mocha/index.d.ts.map +1 -1
  37. package/dist/rules/scopes/svelte/enable.d.ts +19 -91
  38. package/dist/rules/scopes/svelte/enable.d.ts.map +1 -1
  39. package/dist/rules/scopes/svelte/enable.js +20 -153
  40. package/dist/rules/scopes/svelte/enable.js.map +1 -1
  41. package/dist/rules/scopes/svelte/extension/index.d.ts +2 -7
  42. package/dist/rules/scopes/svelte/extension/index.d.ts.map +1 -1
  43. package/dist/rules/scopes/svelte/extension/index.js +2 -11
  44. package/dist/rules/scopes/svelte/extension/index.js.map +1 -1
  45. package/dist/rules/scopes/svelte/index.d.ts +21 -98
  46. package/dist/rules/scopes/svelte/index.d.ts.map +1 -1
  47. package/dist/rules/scopes/ts/enable.d.ts +31 -163
  48. package/dist/rules/scopes/ts/enable.d.ts.map +1 -1
  49. package/dist/rules/scopes/ts/enable.js +32 -380
  50. package/dist/rules/scopes/ts/enable.js.map +1 -1
  51. package/dist/rules/scopes/ts/extension/index.d.ts +1 -20
  52. package/dist/rules/scopes/ts/extension/index.d.ts.map +1 -1
  53. package/dist/rules/scopes/ts/extension/index.js +2 -25
  54. package/dist/rules/scopes/ts/extension/index.js.map +1 -1
  55. package/dist/rules/scopes/ts/index.d.ts +32 -183
  56. package/dist/rules/scopes/ts/index.d.ts.map +1 -1
  57. package/dist/rules/scopes/yml/index.d.ts +12 -43
  58. package/dist/rules/scopes/yml/index.d.ts.map +1 -1
  59. package/dist/rules/scopes/yml/plugin/extension.d.ts +5 -22
  60. package/dist/rules/scopes/yml/plugin/extension.d.ts.map +1 -1
  61. package/dist/rules/scopes/yml/plugin/extension.js +5 -36
  62. package/dist/rules/scopes/yml/plugin/extension.js.map +1 -1
  63. package/dist/rules/scopes/yml/plugin/index.d.ts +7 -21
  64. package/dist/rules/scopes/yml/plugin/index.d.ts.map +1 -1
  65. package/dist/rules/scopes/yml/plugin/index.js +8 -44
  66. package/dist/rules/scopes/yml/plugin/index.js.map +1 -1
  67. package/eslint.config.js +3 -3
  68. package/package.json +56 -56
  69. package/src/files/_factory/index.ts +76 -76
  70. package/src/files/_factory/project/index.ts +2 -2
  71. package/src/files/_factory/project/roots.ts +4 -4
  72. package/src/files/_factory/project/subroots.ts +8 -8
  73. package/src/files/index.ts +23 -23
  74. package/src/files/scopes/css.ts +5 -5
  75. package/src/files/scopes/html.ts +5 -5
  76. package/src/files/scopes/js.ts +5 -5
  77. package/src/files/scopes/json.ts +5 -5
  78. package/src/files/scopes/jsonc.ts +5 -5
  79. package/src/files/scopes/jsoncc.ts +9 -9
  80. package/src/files/scopes/mocha.ts +5 -5
  81. package/src/files/scopes/svelte.ts +5 -5
  82. package/src/files/scopes/ts.ts +5 -5
  83. package/src/files/scopes/yml.ts +8 -8
  84. package/src/ignores/global.ts +5 -5
  85. package/src/ignores/index.ts +25 -25
  86. package/src/ignores/scopes/css.ts +1 -1
  87. package/src/ignores/scopes/html.ts +1 -1
  88. package/src/ignores/scopes/js.ts +1 -1
  89. package/src/ignores/scopes/json.ts +1 -1
  90. package/src/ignores/scopes/jsonc.ts +1 -1
  91. package/src/ignores/scopes/jsoncc.ts +1 -1
  92. package/src/ignores/scopes/mocha.ts +1 -1
  93. package/src/ignores/scopes/svelte.ts +1 -1
  94. package/src/ignores/scopes/ts.ts +1 -1
  95. package/src/ignores/scopes/yml.ts +1 -1
  96. package/src/index.ts +10 -10
  97. package/src/rules/_strings/id.ts +21 -21
  98. package/src/rules/_strings/index.ts +3 -3
  99. package/src/rules/_strings/option.ts +30 -30
  100. package/src/rules/_strings/state.spec.ts +64 -64
  101. package/src/rules/_strings/state.ts +4 -4
  102. package/src/rules/index.ts +23 -23
  103. package/src/rules/scopes/css/enable.ts +31 -31
  104. package/src/rules/scopes/css/index.ts +3 -3
  105. package/src/rules/scopes/enable.style.ts +507 -705
  106. package/src/rules/scopes/enable.ts +390 -401
  107. package/src/rules/scopes/html/index.ts +3 -3
  108. package/src/rules/scopes/html/plugin/index.ts +113 -113
  109. package/src/rules/scopes/index.ts +7 -7
  110. package/src/rules/scopes/json/enable.ts +18 -18
  111. package/src/rules/scopes/json/index.ts +9 -9
  112. package/src/rules/scopes/json/plugin/extension.ts +60 -98
  113. package/src/rules/scopes/json/plugin/index.ts +35 -35
  114. package/src/rules/scopes/jsonc/index.ts +3 -3
  115. package/src/rules/scopes/jsonc/plugin/index.ts +12 -12
  116. package/src/rules/scopes/jsoncc/index.ts +3 -3
  117. package/src/rules/scopes/jsoncc/plugin/index.ts +16 -16
  118. package/src/rules/scopes/mocha/chai/expect.ts +16 -16
  119. package/src/rules/scopes/mocha/chai/index.ts +18 -20
  120. package/src/rules/scopes/mocha/disable.ts +13 -13
  121. package/src/rules/scopes/mocha/enable.ts +36 -52
  122. package/src/rules/scopes/mocha/index.ts +11 -11
  123. package/src/rules/scopes/svelte/disable.ts +19 -19
  124. package/src/rules/scopes/svelte/enable.ts +157 -292
  125. package/src/rules/scopes/svelte/extension/disable.ts +14 -14
  126. package/src/rules/scopes/svelte/extension/index.ts +17 -27
  127. package/src/rules/scopes/svelte/index.ts +11 -11
  128. package/src/rules/scopes/ts/disable.ts +30 -30
  129. package/src/rules/scopes/ts/enable.ts +188 -578
  130. package/src/rules/scopes/ts/extension/disable.ts +35 -35
  131. package/src/rules/scopes/ts/extension/index.ts +62 -87
  132. package/src/rules/scopes/ts/index.ts +11 -11
  133. package/src/rules/scopes/yml/index.ts +7 -7
  134. package/src/rules/scopes/yml/plugin/extension.ts +55 -88
  135. package/src/rules/scopes/yml/plugin/index.ts +38 -88
  136. package/src/settings/global/index.ts +6 -6
  137. package/src/settings/index.ts +7 -7
  138. package/src/settings/registry/index.ts +23 -23
  139. package/src/settings/registry/manifests/css.ts +9 -9
  140. package/src/settings/registry/manifests/html.ts +10 -10
  141. package/src/settings/registry/manifests/js.ts +8 -8
  142. package/src/settings/registry/manifests/json.ts +7 -7
  143. package/src/settings/registry/manifests/jsonc.ts +9 -9
  144. package/src/settings/registry/manifests/jsoncc.ts +9 -9
  145. package/src/settings/registry/manifests/mocha.ts +8 -8
  146. package/src/settings/registry/manifests/svelte.ts +10 -10
  147. package/src/settings/registry/manifests/ts.ts +30 -30
  148. package/src/settings/registry/manifests/yml.ts +9 -9
  149. package/tsconfig.json +75 -156
@@ -1,705 +1,507 @@
1
- import {
2
- ID,
3
- // OFF,
4
- WARN,
5
- ON,
6
- all,
7
- always_multiline,
8
- always,
9
- as_needed,
10
- before,
11
- below,
12
- consistent,
13
- double,
14
- inside,
15
- last,
16
- never,
17
- wildcard,
18
- } from "../_strings";
19
-
20
- export const EnableStyle = {
21
- id: ID.Enable.Style,
22
- rules: {
23
- // DOC: https://eslint.style/rules
24
- "@stylistic/array-bracket-newline": ON,
25
- "@stylistic/array-bracket-spacing": ON,
26
- "@stylistic/array-element-newline": [
27
- ON,
28
- {
29
- consistent: true,
30
- multiline: true,
31
- minItems: 3,
32
- } /* never | consistent | @default always | { ... } */,
33
- ],
34
- "@stylistic/arrow-parens": [
35
- ON,
36
- as_needed /* as-needed | @default always */,
37
- ],
38
- "@stylistic/arrow-spacing": ON,
39
- "@stylistic/block-spacing": ON,
40
- "@stylistic/brace-style": [
41
- ON,
42
- "stroustrup" /* stroustrup | allman | @default 1tbs */,
43
- {
44
- allowSingleLine: true /* @default false */,
45
- },
46
- ],
47
- "@stylistic/comma-dangle": [
48
- ON,
49
- always_multiline,
50
- ],
51
- "@stylistic/comma-spacing": ON,
52
- "@stylistic/comma-style": ON,
53
- "@stylistic/computed-property-spacing": ON,
54
- "@stylistic/curly-newline": ON,
55
- "@stylistic/dot-location": [
56
- ON,
57
- "property" /* property | @default object */,
58
- ],
59
- "@stylistic/eol-last": ON,
60
- "@stylistic/function-call-argument-newline": [
61
- ON,
62
- consistent /* consistent | never | @default always */,
63
- ],
64
- "@stylistic/function-call-spacing": ON,
65
- "@stylistic/function-paren-newline": [
66
- ON,
67
- "multiline-arguments",
68
- ] /* BUG: https://github.com/eslint-stylistic/eslint-stylistic/issues/290 */,
69
- "@stylistic/generator-star-spacing": ON,
70
- "@stylistic/implicit-arrow-linebreak": ON,
71
- "@stylistic/indent": [
72
- ON,
73
- 2 /* tab | number | @default 4 */,
74
- {
75
- // ignoredNodes: [],
76
- SwitchCase: 1,
77
- VariableDeclarator: {
78
- "var": 0,
79
- let: 0,
80
- "const": 0,
81
- },
82
- outerIIFEBody: 0,
83
- // MemberExpression: 1,
84
- // FunctionDeclaration: {
85
- // parameters: 1,
86
- // body: 1,
87
- // returnType: 1,
88
- // },
89
- // FunctionExpression: {
90
- // parameters: 1,
91
- // body: 1,
92
- // returnType: 1,
93
- // },
94
- // StaticBlock: {
95
- // body: 1,
96
- // },
97
- // CallExpression: {
98
- // arguments: 1,
99
- // },
100
- // ArrayExpression: 1,
101
- // ObjectExpression: 1,
102
- // ImportDeclaration: 1,
103
- // flatTernaryExpressions: false,
104
- offsetTernaryExpressions: true,
105
- // offsetTernaryExpressionsOffsetCallExpressions: true,
106
- // ignoreComments: false,
107
- tabLength: 2 /* @default 4 */,
108
- },
109
- ],
110
- "@stylistic/indent-binary-ops": [
111
- ON,
112
- 2,
113
- ],
114
- "@stylistic/key-spacing": ON,
115
- "@stylistic/keyword-spacing": ON,
116
- // "@stylistic/line-comment-position": OFF,
117
- // "@stylistic/lines-around-comment": OFF,
118
- "@stylistic/lines-between-class-members": [
119
- ON,
120
- {
121
- enforce: [
122
- {
123
- prev: "field",
124
- next: "field",
125
- blankLine: never,
126
- },
127
- {
128
- prev: "field",
129
- next: "method",
130
- blankLine: always,
131
- },
132
- {
133
- prev: "method",
134
- next: wildcard,
135
- blankLine: always,
136
- },
137
- ],
138
- },
139
- {
140
- exceptAfterSingleLine: false,
141
- exceptAfterOverload: true /* TS-only */,
142
- },
143
- ],
144
- "@stylistic/max-len": [
145
- ON,
146
- {
147
- code: 300,
148
- tabWidth: 2,
149
- ignoreComments: true,
150
- ignoreTrailingComments: true,
151
- ignoreUrls: true,
152
- ignoreStrings: true,
153
- ignoreTemplateLiterals: true,
154
- ignoreRegExpLiterals: true,
155
- },
156
- ],
157
- "@stylistic/max-statements-per-line": [
158
- ON,
159
- {
160
- max: 1,
161
- },
162
- ],
163
- "@stylistic/member-delimiter-style": [
164
- ON,
165
- {
166
- multiline: {
167
- delimiter: "semi",
168
- requireLast: true,
169
- },
170
- singleline: {
171
- delimiter: "semi",
172
- requireLast: false,
173
- },
174
- multilineDetection: "brackets",
175
- },
176
- ],
177
- // "@stylistic/multiline-comment-style": OFF,
178
- "@stylistic/multiline-ternary": [
179
- ON,
180
- always_multiline,
181
- ],
182
- // "@stylistic/new-parens": OFF,
183
- "@stylistic/newline-per-chained-call": [
184
- ON,
185
- {
186
- ignoreChainWithDepth: 2,
187
- },
188
- ],
189
- // "@stylistic/no-confusing-arrow": OFF,
190
- "@stylistic/no-extra-parens": [
191
- ON,
192
- all,
193
- {
194
- conditionalAssign: true,
195
- returnAssign: true,
196
- nestedBinaryExpressions: true,
197
- ternaryOperandBinaryExpressions: true,
198
- // ignoreJSX: "none" /* all | multi-line | single-line | @default: none */,
199
- enforceForArrowConditionals: true,
200
- enforceForSequenceExpressions: true,
201
- enforceForNewInMemberExpressions: true,
202
- enforceForFunctionPrototypeMethods: true,
203
- // allowParensAfterCommentPattern: "" /* regex */,
204
- nestedConditionalExpressions: true,
205
- allowNodesInSpreadElement: {
206
- ConditionalExpression: false,
207
- LogicalExpression: false,
208
- AwaitExpression: false,
209
- } /* @default: all true */,
210
- },
211
- ],
212
- "@stylistic/no-extra-semi": ON,
213
- "@stylistic/no-floating-decimal": ON,
214
- // "@stylistic/no-mixed-operators": OFF,
215
- "@stylistic/no-mixed-spaces-and-tabs": ON,
216
- "@stylistic/no-multi-spaces": [
217
- ON,
218
- {
219
- ignoreEOLComments: false /* @OVERRIDE */,
220
- exceptions: {
221
- Property: false /* @OVERRIDE */,
222
- ImportAttributes: false /* @OVERRIDE */,
223
- },
224
- includeTabs: true /* @OVERRIDE */,
225
- },
226
- ],
227
- "@stylistic/no-multiple-empty-lines": [
228
- ON,
229
- {
230
- max: 1,
231
- maxBOF: 0,
232
- maxEOF: 0 /* combine with `eol-last` to ensure file still ends with a single line-break (eol character) */,
233
- },
234
- ],
235
- "@stylistic/no-tabs": [
236
- ON,
237
- {
238
- allowIndentationTabs: false,
239
- },
240
- ],
241
- "@stylistic/no-trailing-spaces": [
242
- ON,
243
- {
244
- skipBlankLines: false,
245
- ignoreComments: false,
246
- },
247
- ],
248
- "@stylistic/no-whitespace-before-property": ON,
249
- "@stylistic/nonblock-statement-body-position": [
250
- ON,
251
- below,
252
- {
253
- overrides: {
254
- } /* if | else | while | do | for */,
255
- },
256
- ],
257
- "@stylistic/object-curly-newline": [
258
- ON,
259
- {
260
- ObjectExpression: {
261
- consistent: true,
262
- multiline: true,
263
- minProperties: 3,
264
- },
265
- ObjectPattern: {
266
- consistent: true,
267
- multiline: true,
268
- minProperties: 3,
269
- },
270
- ImportDeclaration: {
271
- consistent: true,
272
- multiline: true,
273
- minProperties: 3,
274
- },
275
- ExportDeclaration: {
276
- consistent: true,
277
- multiline: true,
278
- minProperties: 3,
279
- },
280
- TSTypeLiteral: {
281
- consistent: true,
282
- multiline: true,
283
- minProperties: 3,
284
- },
285
- TSInterfaceBody: {
286
- consistent: true,
287
- multiline: true,
288
- minProperties: 3,
289
- },
290
- TSEnumBody: {
291
- consistent: true,
292
- multiline: true,
293
- minProperties: 3,
294
- },
295
- },
296
- ],
297
- "@stylistic/object-curly-spacing": [
298
- ON,
299
- always,
300
- {
301
- arraysInObjects: true,
302
- objectsInObjects: true,
303
- },
304
- ],
305
- "@stylistic/object-property-newline": ON,
306
- "@stylistic/one-var-declaration-per-line": [
307
- ON,
308
- always,
309
- ],
310
- "@stylistic/operator-linebreak": [
311
- ON,
312
- before,
313
- {
314
- overrides: {} /* e.g., = | ? | : | @default: { "?": "before", ":": "before" } */,
315
- },
316
- ],
317
- "@stylistic/padded-blocks": [
318
- ON,
319
- never /* @OVERRIDE || { blocks, classes, switches } */,
320
- {
321
- allowSingleLineBlocks: true,
322
- },
323
- ],
324
- "@stylistic/padding-line-between-statements": [
325
- WARN,
326
- // #region *<
327
- {
328
- blankLine: never,
329
- prev: [
330
- "block-like",
331
- "block",
332
- "break",
333
- "case",
334
- "cjs-export",
335
- "cjs-import",
336
- "class",
337
- "const",
338
- "continue",
339
- "debugger",
340
- "default",
341
- "directive",
342
- "do",
343
- "empty",
344
- "enum",
345
- "export",
346
- // "expression" /* aren't most of these expressions? */,
347
- "for",
348
- "function-overload",
349
- "function",
350
- "if",
351
- "iife",
352
- "import",
353
- "interface",
354
- "let",
355
- "multiline-block-like",
356
- "multiline-const",
357
- "multiline-export",
358
- // "multiline-expression" /* aren't most of these expressions? */,
359
- "multiline-let",
360
- "multiline-var",
361
- "return",
362
- "singleline-const",
363
- "singleline-export",
364
- "singleline-let",
365
- "singleline-var",
366
- "switch",
367
- "throw",
368
- "try",
369
- "type",
370
- "using",
371
- "var",
372
- "while",
373
- "with",
374
- ],
375
- next: wildcard,
376
- },
377
- // #endregion
378
- // #region < Block >
379
- {
380
- blankLine: always,
381
- prev: [
382
- "block-like",
383
- "block",
384
- "class",
385
- "debugger",
386
- "directive",
387
- "do",
388
- "empty",
389
- "for",
390
- "function-overload",
391
- "function",
392
- "if",
393
- "interface",
394
- "multiline-block-like",
395
- "switch",
396
- "try",
397
- "using",
398
- "while",
399
- "with",
400
- ],
401
- next: wildcard,
402
- },
403
- {
404
- blankLine: always,
405
- prev: wildcard,
406
- next: [
407
- "block-like",
408
- "block",
409
- "class",
410
- "debugger",
411
- "directive",
412
- "do",
413
- "empty",
414
- "for",
415
- "function-overload",
416
- "function",
417
- "if",
418
- "interface",
419
- "multiline-block-like",
420
- "switch",
421
- "try",
422
- "using",
423
- "while",
424
- "with",
425
- ],
426
- },
427
- // #endregion
428
- // #region Declaration >
429
- {
430
- blankLine: never,
431
- prev: "interface",
432
- next: [
433
- "class",
434
- "function-overload",
435
- "function",
436
- ],
437
- },
438
- {
439
- blankLine: never,
440
- prev: "function-overload",
441
- next: [
442
- "function-overload",
443
- "function",
444
- ],
445
- },
446
- // #endregion
447
- // #region < =[]
448
- {
449
- blankLine: always,
450
- prev: [
451
- "const",
452
- "enum",
453
- "let",
454
- "multiline-const",
455
- "multiline-let",
456
- "multiline-var",
457
- "singleline-const",
458
- "singleline-let",
459
- "singleline-var",
460
- "type",
461
- "var",
462
- ],
463
- next: [
464
- "expression",
465
- "multiline-expression",
466
- "iife",
467
- ],
468
- },
469
- // #endregion
470
- // #region Import[] >
471
- {
472
- blankLine: always,
473
- prev: [
474
- "cjs-import",
475
- "import",
476
- ],
477
- next: wildcard,
478
- },
479
- {
480
- blankLine: never,
481
- prev: [
482
- "cjs-import",
483
- "import",
484
- ],
485
- next: [
486
- "cjs-import",
487
- "import",
488
- ],
489
- },
490
- // #endregion
491
- // #region < Export[] >
492
- {
493
- blankLine: always,
494
- prev: [
495
- "cjs-export",
496
- "export",
497
- "multiline-export",
498
- "singleline-export",
499
- ],
500
- next: wildcard,
501
- },
502
- {
503
- blankLine: always,
504
- prev: wildcard,
505
- next: [
506
- "cjs-export",
507
- "export",
508
- "multiline-export",
509
- "singleline-export",
510
- ],
511
- },
512
- {
513
- blankLine: never,
514
- prev: [
515
- "cjs-export",
516
- "export",
517
- "multiline-export",
518
- "singleline-export",
519
- ],
520
- next: [
521
- "cjs-export",
522
- "export",
523
- "multiline-export",
524
- "singleline-export",
525
- ],
526
- },
527
- // #endregion
528
- // #region < Return >
529
- {
530
- blankLine: always,
531
- prev: [
532
- "break",
533
- "continue",
534
- "return",
535
- "throw",
536
- ],
537
- next: wildcard,
538
- },
539
- {
540
- blankLine: always,
541
- prev: wildcard,
542
- next: [
543
- "break",
544
- "continue",
545
- "return",
546
- "throw",
547
- ],
548
- },
549
- // #endregion
550
- ],
551
- "@stylistic/quote-props": [
552
- ON,
553
- as_needed,
554
- {
555
- keywords: true,
556
- unnecessary: true,
557
- numbers: false,
558
- },
559
- ],
560
- "@stylistic/quotes": [
561
- ON,
562
- double,
563
- {
564
- avoidEscape: true,
565
- allowTemplateLiterals: always /* always, avoidEscape, @default: never */,
566
- ignoreStringLiterals: false,
567
- },
568
- ],
569
- "@stylistic/rest-spread-spacing": [
570
- ON,
571
- never,
572
- ],
573
- "@stylistic/semi": [
574
- ON,
575
- always,
576
- {
577
- omitLastInOneLineBlock: false,
578
- omitLastInOneLineClassBody: false,
579
- },
580
- ],
581
- "@stylistic/semi-spacing": [
582
- ON,
583
- {
584
- before: false,
585
- after: true,
586
- },
587
- ],
588
- "@stylistic/semi-style": [
589
- ON,
590
- last,
591
- ],
592
- "@stylistic/space-before-blocks": [
593
- ON,
594
- {
595
- functions: always,
596
- keywords: always,
597
- classes: always,
598
- },
599
- ],
600
- "@stylistic/space-before-function-paren": [
601
- ON,
602
- {
603
- anonymous: always,
604
- named: never,
605
- asyncArrow: always,
606
- "catch": always,
607
- },
608
- ],
609
- "@stylistic/space-in-parens": [
610
- ON,
611
- never,
612
- ],
613
- "@stylistic/space-infix-ops": [
614
- ON,
615
- {
616
- int32Hint: true,
617
- ignoreTypes: false,
618
- },
619
- ],
620
- "@stylistic/space-unary-ops": [
621
- ON,
622
- {
623
- words: true,
624
- nonwords: false,
625
- overrides: {},
626
- },
627
- ],
628
- "@stylistic/spaced-comment": [
629
- ON,
630
- always,
631
- {
632
- line: {
633
- exceptions: [
634
- "/",
635
- "-",
636
- "+",
637
- "=",
638
- ],
639
- markers: [
640
- "!",
641
- "@",
642
- "#",
643
- "/",
644
- "#region",
645
- "#endregion",
646
- "#part",
647
- "/#region",
648
- "/#endregion",
649
- "/#part",
650
- ],
651
- },
652
- block: {
653
- exceptions: ["*"],
654
- markers: ["*"],
655
- balanced: true,
656
- },
657
- },
658
- ],
659
- "@stylistic/switch-colon-spacing": [
660
- ON,
661
- {
662
- after: true,
663
- before: false,
664
- },
665
- ],
666
- "@stylistic/template-curly-spacing": [
667
- ON,
668
- never,
669
- ],
670
- "@stylistic/template-tag-spacing": [
671
- ON,
672
- never,
673
- ],
674
- "@stylistic/type-annotation-spacing": [
675
- ON,
676
- {
677
- before: true,
678
- after: true,
679
- overrides: {
680
- colon: {
681
- before: false,
682
- after: true,
683
- },
684
- },
685
- } /* non-overriden rule affects all type annotations (arrows, "as" keyword, "satisfies" keyword) except colons */,
686
- ],
687
- "@stylistic/type-generic-spacing": ON,
688
- "@stylistic/type-named-tuple-spacing": ON,
689
- "@stylistic/wrap-iife": [
690
- ON,
691
- inside,
692
- {
693
- functionPrototypeMethods: true,
694
- },
695
- ],
696
- "@stylistic/wrap-regex": ON,
697
- "@stylistic/yield-star-spacing": [
698
- ON,
699
- {
700
- before: false,
701
- after: true,
702
- },
703
- ],
704
- } as const,
705
- };
1
+ import {
2
+ ID,
3
+ // OFF,
4
+ WARN,
5
+ ON,
6
+ always_multiline,
7
+ always,
8
+ as_needed,
9
+ before,
10
+ below,
11
+ consistent,
12
+ double,
13
+ inside,
14
+ never,
15
+ wildcard,
16
+ } from "../_strings";
17
+
18
+ export const EnableStyle = {
19
+ id: ID.Enable.Style,
20
+ rules: {
21
+ // DOC: https://eslint.style/rules
22
+ "@stylistic/array-bracket-newline": ON,
23
+ "@stylistic/array-bracket-spacing": ON,
24
+ "@stylistic/array-element-newline": [
25
+ ON,
26
+ {
27
+ consistent: true,
28
+ multiline: true,
29
+ minItems: 3,
30
+ } /* never | consistent | @default always | { ... } */,
31
+ ],
32
+ "@stylistic/arrow-parens": [
33
+ ON,
34
+ as_needed /* as-needed | @default always */,
35
+ ],
36
+ "@stylistic/arrow-spacing": ON,
37
+ "@stylistic/block-spacing": ON,
38
+ "@stylistic/brace-style": [
39
+ ON,
40
+ "stroustrup" /* stroustrup | allman | @default 1tbs */,
41
+ {
42
+ allowSingleLine: true /* @default false */,
43
+ },
44
+ ],
45
+ "@stylistic/comma-dangle": [
46
+ ON,
47
+ always_multiline,
48
+ ],
49
+ "@stylistic/comma-spacing": ON,
50
+ "@stylistic/comma-style": ON,
51
+ "@stylistic/computed-property-spacing": ON,
52
+ "@stylistic/curly-newline": ON,
53
+ "@stylistic/dot-location": [
54
+ ON,
55
+ "property" /* property | @default object */,
56
+ ],
57
+ "@stylistic/eol-last": ON,
58
+ "@stylistic/function-call-argument-newline": [
59
+ ON,
60
+ consistent /* consistent | never | @default always */,
61
+ ],
62
+ "@stylistic/function-call-spacing": ON,
63
+ "@stylistic/function-paren-newline": [
64
+ ON,
65
+ "multiline-arguments",
66
+ ] /* BUG: https://github.com/eslint-stylistic/eslint-stylistic/issues/290 */,
67
+ "@stylistic/generator-star-spacing": ON,
68
+ "@stylistic/implicit-arrow-linebreak": ON,
69
+ "@stylistic/indent": [
70
+ ON,
71
+ 2 /* tab | number | @default 4 */,
72
+ {
73
+ VariableDeclarator: {
74
+ "var": 0,
75
+ let: 0,
76
+ "const": 0,
77
+ },
78
+ outerIIFEBody: 0,
79
+ offsetTernaryExpressions: true,
80
+ },
81
+ ],
82
+ "@stylistic/indent-binary-ops": [
83
+ ON,
84
+ 2 /* MUST be same as `@stylistic/indent`[1] */,
85
+ ],
86
+ "@stylistic/key-spacing": ON,
87
+ "@stylistic/keyword-spacing": ON,
88
+ // "@stylistic/line-comment-position": OFF,
89
+ // "@stylistic/lines-around-comment": OFF,
90
+ "@stylistic/lines-between-class-members": [
91
+ ON,
92
+ {
93
+ enforce: [
94
+ {
95
+ prev: "field",
96
+ next: "field",
97
+ blankLine: never,
98
+ },
99
+ {
100
+ prev: "field",
101
+ next: "method",
102
+ blankLine: always,
103
+ },
104
+ {
105
+ prev: "method",
106
+ next: wildcard,
107
+ blankLine: always,
108
+ },
109
+ ],
110
+ },
111
+ ],
112
+ "@stylistic/max-len": [
113
+ ON,
114
+ {
115
+ code: 300 /* @default 80 */,
116
+ // tabWidth: 4,
117
+ ignoreComments: true,
118
+ ignoreTrailingComments: true,
119
+ ignoreUrls: true,
120
+ ignoreStrings: true,
121
+ ignoreTemplateLiterals: true,
122
+ ignoreRegExpLiterals: true,
123
+ },
124
+ ],
125
+ "@stylistic/max-statements-per-line": ON,
126
+ "@stylistic/member-delimiter-style": ON,
127
+ // "@stylistic/multiline-comment-style": OFF,
128
+ "@stylistic/multiline-ternary": [
129
+ ON,
130
+ always_multiline /* never | always-multiline | @default always */,
131
+ ],
132
+ // "@stylistic/new-parens": OFF,
133
+ "@stylistic/newline-per-chained-call": ON,
134
+ // "@stylistic/no-confusing-arrow": OFF,
135
+ "@stylistic/no-extra-parens": ON,
136
+ "@stylistic/no-extra-semi": ON,
137
+ "@stylistic/no-floating-decimal": ON,
138
+ // "@stylistic/no-mixed-operators": OFF,
139
+ "@stylistic/no-mixed-spaces-and-tabs": ON,
140
+ "@stylistic/no-multi-spaces": [
141
+ ON,
142
+ {
143
+ exceptions: {
144
+ Property: false,
145
+ ImportAttributes: false,
146
+ },
147
+ },
148
+ ],
149
+ "@stylistic/no-multiple-empty-lines": [
150
+ ON,
151
+ {
152
+ max: 1 /* @default 2 */,
153
+ maxBOF: 0,
154
+ maxEOF: 0 /* combine with `eol-last` to ensure file still ends with a single line-break (eol character) */,
155
+ },
156
+ ],
157
+ "@stylistic/no-tabs": ON,
158
+ "@stylistic/no-trailing-spaces": ON,
159
+ "@stylistic/no-whitespace-before-property": ON,
160
+ "@stylistic/nonblock-statement-body-position": [
161
+ ON,
162
+ below /* any | below | @default beside */,
163
+ ],
164
+ "@stylistic/object-curly-newline": [
165
+ ON,
166
+ {
167
+ consistent: true,
168
+ multiline: true,
169
+ minProperties: 3,
170
+ },
171
+ ],
172
+ "@stylistic/object-curly-spacing": [
173
+ ON,
174
+ always /* always | @default never */,
175
+ ],
176
+ "@stylistic/object-property-newline": ON,
177
+ "@stylistic/one-var-declaration-per-line": [
178
+ ON,
179
+ always /* always | @default initializations */,
180
+ ],
181
+ "@stylistic/operator-linebreak": [
182
+ ON,
183
+ before /* ignore | none | before | @default after */,
184
+ ],
185
+ "@stylistic/padded-blocks": [
186
+ ON,
187
+ never /* never | start | end | @default always */,
188
+ {
189
+ allowSingleLineBlocks: true,
190
+ },
191
+ ],
192
+ "@stylistic/padding-line-between-statements": [
193
+ WARN,
194
+ // #region *<
195
+ {
196
+ blankLine: never,
197
+ prev: [
198
+ "block-like",
199
+ "block",
200
+ "break",
201
+ "case",
202
+ "cjs-export",
203
+ "cjs-import",
204
+ "class",
205
+ "const",
206
+ "continue",
207
+ "debugger",
208
+ "default",
209
+ "directive",
210
+ "do",
211
+ "empty",
212
+ "enum",
213
+ "export",
214
+ // "expression" /* aren't most of these expressions? */,
215
+ "for",
216
+ "function-overload",
217
+ "function",
218
+ "if",
219
+ "iife",
220
+ "import",
221
+ "interface",
222
+ "let",
223
+ "multiline-block-like",
224
+ "multiline-const",
225
+ "multiline-export",
226
+ // "multiline-expression" /* aren't most of these expressions? */,
227
+ "multiline-let",
228
+ "multiline-var",
229
+ "return",
230
+ "singleline-const",
231
+ "singleline-export",
232
+ "singleline-let",
233
+ "singleline-var",
234
+ "switch",
235
+ "throw",
236
+ "try",
237
+ "type",
238
+ "using",
239
+ "var",
240
+ "while",
241
+ "with",
242
+ ],
243
+ next: wildcard,
244
+ },
245
+ // #endregion
246
+ // #region <Block>
247
+ {
248
+ blankLine: always,
249
+ prev: [
250
+ "block-like",
251
+ "block",
252
+ "class",
253
+ "debugger",
254
+ "directive",
255
+ "do",
256
+ "empty",
257
+ "for",
258
+ "function-overload",
259
+ "function",
260
+ "if",
261
+ "interface",
262
+ "multiline-block-like",
263
+ "switch",
264
+ "try",
265
+ "using",
266
+ "while",
267
+ "with",
268
+ ],
269
+ next: wildcard,
270
+ },
271
+ {
272
+ blankLine: always,
273
+ prev: wildcard,
274
+ next: [
275
+ "block-like",
276
+ "block",
277
+ "class",
278
+ "debugger",
279
+ "directive",
280
+ "do",
281
+ "empty",
282
+ "for",
283
+ "function-overload",
284
+ "function",
285
+ "if",
286
+ "interface",
287
+ "multiline-block-like",
288
+ "switch",
289
+ "try",
290
+ "using",
291
+ "while",
292
+ "with",
293
+ ],
294
+ },
295
+ // #endregion
296
+ // #region Declaration>
297
+ {
298
+ blankLine: never,
299
+ prev: "interface",
300
+ next: [
301
+ "class",
302
+ "function-overload",
303
+ "function",
304
+ ],
305
+ },
306
+ {
307
+ blankLine: never,
308
+ prev: "function-overload",
309
+ next: [
310
+ "function-overload",
311
+ "function",
312
+ ],
313
+ },
314
+ // #endregion
315
+ // #region <=[]
316
+ {
317
+ blankLine: always,
318
+ prev: [
319
+ "const",
320
+ "enum",
321
+ "let",
322
+ "multiline-const",
323
+ "multiline-let",
324
+ "multiline-var",
325
+ "singleline-const",
326
+ "singleline-let",
327
+ "singleline-var",
328
+ "type",
329
+ "var",
330
+ ],
331
+ next: [
332
+ "expression",
333
+ "multiline-expression",
334
+ "iife",
335
+ ],
336
+ },
337
+ // #endregion
338
+ // #region Import[]>
339
+ {
340
+ blankLine: always,
341
+ prev: [
342
+ "cjs-import",
343
+ "import",
344
+ ],
345
+ next: wildcard,
346
+ },
347
+ {
348
+ blankLine: never,
349
+ prev: [
350
+ "cjs-import",
351
+ "import",
352
+ ],
353
+ next: [
354
+ "cjs-import",
355
+ "import",
356
+ ],
357
+ },
358
+ // #endregion
359
+ // #region <Export[]>
360
+ {
361
+ blankLine: always,
362
+ prev: [
363
+ "cjs-export",
364
+ "export",
365
+ "multiline-export",
366
+ "singleline-export",
367
+ ],
368
+ next: wildcard,
369
+ },
370
+ {
371
+ blankLine: always,
372
+ prev: wildcard,
373
+ next: [
374
+ "cjs-export",
375
+ "export",
376
+ "multiline-export",
377
+ "singleline-export",
378
+ ],
379
+ },
380
+ {
381
+ blankLine: never,
382
+ prev: [
383
+ "cjs-export",
384
+ "export",
385
+ "multiline-export",
386
+ "singleline-export",
387
+ ],
388
+ next: [
389
+ "cjs-export",
390
+ "export",
391
+ "multiline-export",
392
+ "singleline-export",
393
+ ],
394
+ },
395
+ // #endregion
396
+ // #region <Return>
397
+ {
398
+ blankLine: always,
399
+ prev: [
400
+ "break",
401
+ "continue",
402
+ "return",
403
+ "throw",
404
+ ],
405
+ next: wildcard,
406
+ },
407
+ {
408
+ blankLine: always,
409
+ prev: wildcard,
410
+ next: [
411
+ "break",
412
+ "continue",
413
+ "return",
414
+ "throw",
415
+ ],
416
+ },
417
+ // #endregion
418
+ ],
419
+ "@stylistic/quote-props": [
420
+ ON,
421
+ as_needed,
422
+ {
423
+ keywords: true,
424
+ },
425
+ ],
426
+ "@stylistic/quotes": [
427
+ ON,
428
+ double /* @default double */,
429
+ {
430
+ avoidEscape: true,
431
+ allowTemplateLiterals: always /* always | avoidEscape | @default never */,
432
+ },
433
+ ],
434
+ "@stylistic/rest-spread-spacing": ON,
435
+ "@stylistic/semi": ON,
436
+ "@stylistic/semi-spacing": ON,
437
+ "@stylistic/semi-style": ON,
438
+ "@stylistic/space-before-blocks": ON,
439
+ "@stylistic/space-before-function-paren": [
440
+ ON,
441
+ {
442
+ named: never,
443
+ },
444
+ ],
445
+ "@stylistic/space-in-parens": ON,
446
+ "@stylistic/space-infix-ops": ON,
447
+ "@stylistic/space-unary-ops": ON,
448
+ "@stylistic/spaced-comment": [
449
+ ON,
450
+ always,
451
+ {
452
+ line: {
453
+ exceptions: [
454
+ "/",
455
+ "-",
456
+ "+",
457
+ "=",
458
+ ],
459
+ markers: [
460
+ "!",
461
+ "@",
462
+ "#",
463
+ "/",
464
+ "#region",
465
+ "#endregion",
466
+ "#part",
467
+ "/#region",
468
+ "/#endregion",
469
+ "/#part",
470
+ ],
471
+ },
472
+ block: {
473
+ exceptions: ["*"],
474
+ markers: ["*"],
475
+ balanced: true,
476
+ },
477
+ },
478
+ ],
479
+ "@stylistic/switch-colon-spacing": ON,
480
+ "@stylistic/template-curly-spacing": ON,
481
+ "@stylistic/template-tag-spacing": ON,
482
+ "@stylistic/type-annotation-spacing": [
483
+ ON,
484
+ {
485
+ before: true,
486
+ after: true,
487
+ overrides: {
488
+ colon: {
489
+ before: false,
490
+ after: true,
491
+ },
492
+ },
493
+ } /* non-overriden rule affects all type annotations (arrows, "as" keyword, "satisfies" keyword) except colons */,
494
+ ],
495
+ "@stylistic/type-generic-spacing": ON,
496
+ "@stylistic/type-named-tuple-spacing": ON,
497
+ "@stylistic/wrap-iife": [
498
+ ON,
499
+ inside,
500
+ {
501
+ functionPrototypeMethods: true,
502
+ },
503
+ ],
504
+ "@stylistic/wrap-regex": ON,
505
+ "@stylistic/yield-star-spacing": ON,
506
+ } as const,
507
+ };