linted 16.12.2-rc.1 → 16.12.2-rc.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. package/.github/workflows/RELEASE.yml +35 -35
  2. package/.github/workflows/rc.yml +35 -35
  3. package/LICENSE +21 -21
  4. package/README.md +390 -390
  5. package/SECURITY.md +9 -9
  6. package/dist/imports/plugins.d.ts.map +1 -1
  7. package/dist/imports.d.ts.map +1 -1
  8. package/dist/rules/_html.d.ts +8 -0
  9. package/dist/rules/_html.d.ts.map +1 -0
  10. package/dist/rules/_html.js +4 -0
  11. package/dist/rules/_html.js.map +1 -0
  12. package/dist/rules/_js.d.ts +765 -0
  13. package/dist/rules/_js.d.ts.map +1 -0
  14. package/dist/rules/_js.js +4 -0
  15. package/dist/rules/_js.js.map +1 -0
  16. package/dist/rules/_json.d.ts +74 -0
  17. package/dist/rules/_json.d.ts.map +1 -0
  18. package/dist/rules/_json.js +4 -0
  19. package/dist/rules/_json.js.map +1 -0
  20. package/dist/rules/_jsonc.d.ts +77 -0
  21. package/dist/rules/_jsonc.d.ts.map +1 -0
  22. package/dist/rules/_jsonc.js +4 -0
  23. package/dist/rules/_jsonc.js.map +1 -0
  24. package/dist/rules/_md.d.ts +7 -0
  25. package/dist/rules/_md.d.ts.map +1 -0
  26. package/dist/rules/_md.js +3 -0
  27. package/dist/rules/_md.js.map +1 -0
  28. package/dist/rules/_mocha.d.ts +8 -0
  29. package/dist/rules/_mocha.d.ts.map +1 -0
  30. package/dist/rules/_mocha.js +4 -0
  31. package/dist/rules/_mocha.js.map +1 -0
  32. package/dist/rules/_svelte.d.ts +1269 -0
  33. package/dist/rules/_svelte.d.ts.map +1 -0
  34. package/dist/rules/_svelte.js +15 -0
  35. package/dist/rules/_svelte.js.map +1 -0
  36. package/dist/rules/_ts.d.ts +1133 -0
  37. package/dist/rules/_ts.d.ts.map +1 -0
  38. package/dist/rules/_ts.js +13 -0
  39. package/dist/rules/_ts.js.map +1 -0
  40. package/dist/rules/_yml.d.ts +73 -0
  41. package/dist/rules/_yml.d.ts.map +1 -0
  42. package/dist/rules/_yml.js +4 -0
  43. package/dist/rules/_yml.js.map +1 -0
  44. package/dist/rules/html/_enable.d.ts +8 -0
  45. package/dist/rules/html/_enable.d.ts.map +1 -0
  46. package/dist/rules/html/_enable.js +10 -0
  47. package/dist/rules/html/_enable.js.map +1 -0
  48. package/dist/rules/html/_recommended.d.ts +3 -0
  49. package/dist/rules/html/_recommended.d.ts.map +1 -0
  50. package/dist/rules/html/_recommended.js +5 -0
  51. package/dist/rules/html/_recommended.js.map +1 -0
  52. package/dist/rules/js/_enable.d.ts +348 -0
  53. package/dist/rules/js/_enable.d.ts.map +1 -0
  54. package/dist/rules/js/_enable.js +260 -0
  55. package/dist/rules/js/_enable.js.map +1 -0
  56. package/dist/rules/js/stylistic.d.ts +420 -0
  57. package/dist/rules/js/stylistic.d.ts.map +1 -0
  58. package/dist/rules/js/stylistic.js +270 -0
  59. package/dist/rules/js/stylistic.js.map +1 -0
  60. package/dist/rules/json/_enable.d.ts +27 -0
  61. package/dist/rules/json/_enable.d.ts.map +1 -0
  62. package/dist/rules/json/_enable.js +31 -0
  63. package/dist/rules/json/_enable.js.map +1 -0
  64. package/dist/rules/md/_enable.d.ts +7 -0
  65. package/dist/rules/md/_enable.d.ts.map +1 -0
  66. package/dist/rules/md/_enable.js +9 -0
  67. package/dist/rules/md/_enable.js.map +1 -0
  68. package/dist/rules/mocha/_enable.d.ts +3 -0
  69. package/dist/rules/mocha/_enable.d.ts.map +1 -0
  70. package/dist/rules/mocha/_enable.js +4 -0
  71. package/dist/rules/mocha/_enable.js.map +1 -0
  72. package/dist/rules/mocha/_recommended.d.ts +3 -0
  73. package/dist/rules/mocha/_recommended.d.ts.map +1 -0
  74. package/dist/rules/mocha/_recommended.js +5 -0
  75. package/dist/rules/mocha/_recommended.js.map +1 -0
  76. package/dist/rules/svelte/_enable.d.ts +126 -0
  77. package/dist/rules/svelte/_enable.d.ts.map +1 -0
  78. package/dist/rules/svelte/_enable.js +90 -0
  79. package/dist/rules/svelte/_enable.js.map +1 -0
  80. package/dist/rules/svelte/disable_x.d.ts +5 -0
  81. package/dist/rules/svelte/disable_x.d.ts.map +1 -0
  82. package/dist/rules/svelte/disable_x.js +4 -0
  83. package/dist/rules/svelte/disable_x.js.map +1 -0
  84. package/dist/rules/ts/_enable.d.ts +262 -0
  85. package/dist/rules/ts/_enable.d.ts.map +1 -0
  86. package/dist/rules/ts/_enable.js +359 -0
  87. package/dist/rules/ts/_enable.js.map +1 -0
  88. package/dist/rules/ts/disable_compiler.d.ts +18 -0
  89. package/dist/rules/ts/disable_compiler.d.ts.map +1 -0
  90. package/dist/rules/ts/disable_compiler.js +22 -0
  91. package/dist/rules/ts/disable_compiler.js.map +1 -0
  92. package/dist/rules/yml/_enable.d.ts +39 -0
  93. package/dist/rules/yml/_enable.d.ts.map +1 -0
  94. package/dist/rules/yml/_enable.js +28 -0
  95. package/dist/rules/yml/_enable.js.map +1 -0
  96. package/eslint.config.js +3 -3
  97. package/package.json +99 -99
  98. package/src/files/html.ts +1 -1
  99. package/src/files/js.ts +1 -1
  100. package/src/files/json.ts +1 -1
  101. package/src/files/jsonc.ts +4 -4
  102. package/src/files/md.ts +1 -1
  103. package/src/files/mocha.ts +1 -1
  104. package/src/files/svelte.ts +1 -1
  105. package/src/files/ts.ts +5 -5
  106. package/src/files/yml.ts +5 -5
  107. package/src/files.ts +22 -22
  108. package/src/imports/parsers.ts +15 -15
  109. package/src/imports/plugins.ts +19 -19
  110. package/src/imports.ts +8 -8
  111. package/src/index.ts +36 -36
  112. package/src/rules/_strings/id.ts +18 -18
  113. package/src/rules/_strings/level.ts +6 -6
  114. package/src/rules/_strings/state.ts +56 -56
  115. package/src/rules/_strings.ts +6 -6
  116. package/src/rules/html/enable.ts +16 -16
  117. package/src/rules/html/enable_recommended.ts +9 -9
  118. package/src/rules/html.ts +4 -4
  119. package/src/rules/js/enable.ts +524 -524
  120. package/src/rules/js/enable_stylistic.ts +608 -608
  121. package/src/rules/js.ts +4 -4
  122. package/src/rules/json/enable.ts +33 -33
  123. package/src/rules/json/enable_x.ts +89 -89
  124. package/src/rules/json.ts +4 -4
  125. package/src/rules/jsonc/override.ts +16 -16
  126. package/src/rules/jsonc.ts +4 -4
  127. package/src/rules/md/enable.ts +15 -15
  128. package/src/rules/md.ts +3 -3
  129. package/src/rules/mocha/enable.ts +3 -3
  130. package/src/rules/mocha/enable_recommended.ts +9 -9
  131. package/src/rules/mocha.ts +4 -4
  132. package/src/rules/svelte/disable.ts +9 -9
  133. package/src/rules/svelte/disable_js.ts +11 -11
  134. package/src/rules/svelte/disable_ts.ts +9 -9
  135. package/src/rules/svelte/enable.ts +228 -228
  136. package/src/rules/svelte/enable_x.ts +20 -20
  137. package/src/rules/svelte.ts +15 -15
  138. package/src/rules/ts/disable.ts +22 -22
  139. package/src/rules/ts/disable_x.ts +32 -32
  140. package/src/rules/ts/enable.ts +549 -549
  141. package/src/rules/ts/enable_x.ts +115 -115
  142. package/src/rules/ts.ts +13 -13
  143. package/src/rules/yml/enable.ts +64 -64
  144. package/src/rules/yml/enable_x.ts +68 -68
  145. package/src/rules/yml.ts +4 -4
  146. package/src/rules.ts +22 -22
  147. package/tsconfig.json +161 -161
  148. package/types/markdownlint/index.d.ts +3 -3
  149. package/types/markdownlint/parser.d.ts +9 -9
  150. package/types/mocha/index.d.ts +8 -8
@@ -1,608 +1,608 @@
1
- import { stylistic, level, state } from "../_strings.js";
2
-
3
- const
4
- { ERROR, OFF } = level,
5
- {
6
- Never,
7
- Always,
8
- AlwaysMultiline,
9
- Consistent,
10
- AsNeeded,
11
- Strict,
12
- All,
13
- Star,
14
- Last,
15
- Before,
16
- After,
17
- Below,
18
- Beside,
19
- Inside,
20
- Double,
21
- } = state;
22
-
23
- export default [
24
- stylistic,
25
- {
26
- // https://eslint.style/rules
27
- "@stylistic/array-bracket-newline": [
28
- ERROR,
29
- {
30
- multiline: true,
31
- minItems: null,
32
- },
33
- ],
34
- "@stylistic/array-bracket-spacing": [
35
- ERROR,
36
- Never,
37
- {
38
- singleValue: false,
39
- objectsInArrays: false,
40
- arraysInArrays: false,
41
- },
42
- ],
43
- "@stylistic/array-element-newline": [
44
- ERROR,
45
- {
46
- ArrayExpression: {
47
- consistent: true,
48
- multiline: true,
49
- minItems: 4,
50
- },
51
- ArrayPattern: {
52
- consistent: true,
53
- multiline: true,
54
- minItems: 4,
55
- },
56
- },
57
- ],
58
- "@stylistic/arrow-parens": [
59
- ERROR,
60
- AsNeeded,
61
- {
62
- requireForBlockBody: false,
63
- },
64
- ],
65
- "@stylistic/arrow-spacing": [
66
- ERROR,
67
- {
68
- before: true,
69
- after: true,
70
- },
71
- ],
72
- "@stylistic/block-spacing": [ERROR, Always],
73
- "@stylistic/brace-style": [
74
- ERROR,
75
- "stroustrup",
76
- {
77
- allowSingleLine: true,
78
- },
79
- ],
80
- "@stylistic/comma-dangle": [ERROR, AlwaysMultiline],
81
- "@stylistic/comma-spacing": [
82
- ERROR,
83
- {
84
- before: false,
85
- after: true,
86
- },
87
- ],
88
- "@stylistic/comma-style": [
89
- ERROR,
90
- Last,
91
- {
92
- exceptions: {
93
- ArrayExpression: false,
94
- ArrayPattern: false,
95
- ArrowFunctionExpression: false,
96
- CallExpression: false,
97
- FunctionDeclaration: false,
98
- FunctionExpression: false,
99
- ImportDeclaration: false,
100
- ObjectExpression: false,
101
- ObjectPattern: false,
102
- VariableDeclaration: false,
103
- NewExpression: false,
104
- },
105
- },
106
- ],
107
- "@stylistic/computed-property-spacing": [
108
- ERROR,
109
- Never,
110
- {
111
- enforceForClassMembers: true,
112
- },
113
- ],
114
- "@stylistic/dot-location": [ERROR, "property"],
115
- "@stylistic/eol-last": [ERROR, Always],
116
- "@stylistic/function-call-argument-newline": [ERROR, Consistent],
117
- "@stylistic/function-call-spacing": [ERROR, Never],
118
-
119
- "@stylistic/function-paren-newline": [ERROR, "multiline-arguments"] /* BUG: https://github.com/eslint-stylistic/eslint-stylistic/issues/290 */,
120
- "@stylistic/generator-star-spacing": [
121
- ERROR,
122
- {
123
- before: true,
124
- after: false,
125
- },
126
- ],
127
- "@stylistic/implicit-arrow-linebreak": [ERROR, Beside],
128
- "@stylistic/indent": [
129
- ERROR,
130
- 2,
131
- {
132
- ignoredNodes: [],
133
- SwitchCase: 1,
134
- VariableDeclarator: { "var": 0, let: 0, "const": 0 },
135
- outerIIFEBody: 0,
136
- MemberExpression: 1,
137
- FunctionDeclaration: { parameters: 1, body: 1 },
138
- FunctionExpression: { parameters: 1, body: 1 },
139
- StaticBlock: { body: 1 },
140
- CallExpression: { arguments: 1 },
141
- ArrayExpression: 1,
142
- ObjectExpression: 1,
143
- ImportDeclaration: 1,
144
- flatTernaryExpressions: false,
145
- offsetTernaryExpressions: true,
146
- ignoreComments: false,
147
- },
148
- ],
149
- "@stylistic/indent-binary-ops": [ERROR, 2],
150
- "@stylistic/key-spacing": [
151
- ERROR,
152
- {
153
- beforeColon: false,
154
- afterColon: true,
155
- mode: Strict,
156
- },
157
- ],
158
- "@stylistic/keyword-spacing": [
159
- ERROR,
160
- {
161
- before: true,
162
- after: true,
163
- overrides: {},
164
- },
165
- ],
166
- "@stylistic/line-comment-position": OFF,
167
- "@stylistic/lines-around-comment": [
168
- ERROR,
169
- {
170
- beforeBlockComment: false,
171
- afterBlockComment: false,
172
- beforeLineComment: true,
173
- afterLineComment: false,
174
- allowBlockStart: true,
175
- allowBlockEnd: true,
176
- allowObjectStart: true,
177
- allowObjectEnd: true,
178
- allowArrayStart: true,
179
- allowArrayEnd: true,
180
- allowClassStart: true,
181
- allowClassEnd: true,
182
- applyDefaultIgnorePatterns: true,
183
- afterHashbangComment: false,
184
-
185
- // TS-only
186
- allowEnumEnd: true,
187
- allowEnumStart: true,
188
- allowInterfaceEnd: true,
189
- allowInterfaceStart: true,
190
- allowModuleEnd: true,
191
- allowModuleStart: true,
192
- allowTypeEnd: true,
193
- allowTypeStart: true,
194
- },
195
- ],
196
- "@stylistic/lines-between-class-members": [
197
- ERROR,
198
- {
199
- enforce: [
200
- { prev: "field", next: "field", blankLine: Never },
201
- { prev: "field", next: "method", blankLine: Always },
202
- { prev: "method", next: Star, blankLine: Always },
203
- ],
204
- },
205
- {
206
- exceptAfterSingleLine: false,
207
- exceptAfterOverload: true /* TS-only */,
208
- },
209
- ],
210
- "@stylistic/max-len": [
211
- ERROR,
212
- {
213
- code: 150,
214
- tabWidth: 2,
215
- ignoreComments: true,
216
- ignoreTrailingComments: true,
217
- ignoreUrls: true,
218
- ignoreStrings: true,
219
- ignoreTemplateLiterals: true,
220
- ignoreRegExpLiterals: true,
221
- },
222
- ],
223
- "@stylistic/max-statements-per-line": [
224
- ERROR,
225
- {
226
- max: 1,
227
- },
228
- ],
229
- "@stylistic/member-delimiter-style": [
230
- ERROR,
231
- {
232
- multiline: {
233
- delimiter: "semi",
234
- requireLast: true,
235
- },
236
- singleline: {
237
- delimiter: "semi",
238
- requireLast: false,
239
- },
240
- multilineDetection: "brackets",
241
- },
242
- ],
243
- "@stylistic/multiline-comment-style": OFF,
244
- "@stylistic/multiline-ternary": [ERROR, AlwaysMultiline],
245
- "@stylistic/new-parens": [OFF, Never],
246
- "@stylistic/newline-per-chained-call": [
247
- ERROR,
248
- {
249
- ignoreChainWithDepth: 2,
250
- },
251
- ],
252
- "@stylistic/no-confusing-arrow": OFF,
253
- "@stylistic/no-extra-parens": [
254
- ERROR,
255
- All,
256
- {
257
- conditionalAssign: true,
258
- returnAssign: true,
259
- nestedBinaryExpressions: true,
260
- ternaryOperandBinaryExpressions: true,
261
- enforceForArrowConditionals: true,
262
- enforceForSequenceExpressions: true,
263
- enforceForNewInMemberExpressions: true,
264
- enforceForFunctionPrototypeMethods: true,
265
- },
266
- ],
267
- "@stylistic/no-extra-semi": ERROR,
268
- "@stylistic/no-floating-decimal": ERROR,
269
- "@stylistic/no-mixed-operators": OFF,
270
- "@stylistic/no-mixed-spaces-and-tabs": ERROR,
271
- "@stylistic/no-multi-spaces": [
272
- ERROR,
273
- {
274
- ignoreEOLComments: false,
275
- exceptions: { Property: false },
276
- includeTabs: true,
277
- },
278
- ],
279
- "@stylistic/no-multiple-empty-lines": [
280
- ERROR,
281
- {
282
- max: 1,
283
- maxEOF: 1,
284
- maxBOF: 0,
285
- },
286
- ],
287
- "@stylistic/no-tabs": [
288
- ERROR,
289
- {
290
- allowIndentationTabs: false,
291
- },
292
- ],
293
- "@stylistic/no-trailing-spaces": [
294
- ERROR,
295
- {
296
- skipBlankLines: false,
297
- ignoreComments: false,
298
- },
299
- ],
300
- "@stylistic/no-whitespace-before-property": ERROR,
301
- "@stylistic/nonblock-statement-body-position": [
302
- ERROR,
303
- Below,
304
- {
305
- overrides: {
306
- "if": Below,
307
- "else": Below,
308
- "while": Below,
309
- "do": Below,
310
- "for": Below,
311
- },
312
- },
313
- ],
314
- "@stylistic/object-curly-newline": [
315
- ERROR,
316
- {
317
- ObjectExpression: {
318
- consistent: true,
319
- multiline: true,
320
- minProperties: 4,
321
- },
322
- ObjectPattern: {
323
- consistent: true,
324
- multiline: true,
325
- minProperties: 4,
326
- },
327
- ImportDeclaration: {
328
- consistent: true,
329
- multiline: true,
330
- minProperties: 4,
331
- },
332
- ExportDeclaration: {
333
- consistent: true,
334
- multiline: true,
335
- minProperties: 4,
336
- },
337
- },
338
- ],
339
- "@stylistic/object-curly-spacing": [
340
- ERROR,
341
- Always,
342
- {
343
- arraysInObjects: true,
344
- objectsInObjects: true,
345
- },
346
- ],
347
- "@stylistic/object-property-newline": [
348
- ERROR,
349
- {
350
- allowAllPropertiesOnSameLine: true,
351
- },
352
- ],
353
- "@stylistic/one-var-declaration-per-line": [ERROR, Always],
354
- "@stylistic/operator-linebreak": [
355
- ERROR,
356
- Before,
357
- {
358
- overrides: {
359
- "=": After,
360
- },
361
- },
362
- ],
363
- "@stylistic/padded-blocks": [
364
- ERROR,
365
- {
366
- blocks: Never,
367
- classes: Never,
368
- switches: Never,
369
- },
370
- {
371
- allowSingleLineBlocks: true,
372
- },
373
- ],
374
- "@stylistic/padding-line-between-statements": [
375
- ERROR,
376
- {
377
- prev: "directive",
378
- next: Star,
379
- blankLine: Always,
380
- },
381
- {
382
- prev: "directive",
383
- next: "directive",
384
- blankLine: Never,
385
- },
386
- {
387
- prev: ["import", "cjs-import"],
388
- next: Star,
389
- blankLine: Always,
390
- },
391
- {
392
- prev: ["import", "cjs-import"],
393
- next: ["import", "cjs-import"],
394
- blankLine: Never,
395
- },
396
- {
397
- prev: [
398
- "class",
399
- "interface",
400
- "try",
401
- "for",
402
- "if",
403
- "do",
404
- "while",
405
- "switch",
406
- "block",
407
- "block-like",
408
- "iife",
409
- "empty",
410
- "debugger",
411
- "with",
412
- ],
413
- next: Star,
414
- blankLine: Always,
415
- },
416
- {
417
- prev: "case",
418
- next: Star,
419
- blankLine: Always,
420
- },
421
- {
422
- prev: "case",
423
- next: ["case", "default"],
424
- blankLine: Always,
425
- },
426
- {
427
- prev: "default",
428
- next: Star,
429
- blankLine: Always,
430
- },
431
- {
432
- prev: "type",
433
- next: Star,
434
- blankLine: Always,
435
- },
436
- {
437
- prev: "type",
438
- next: "type",
439
- blankLine: Never,
440
- },
441
- {
442
- prev: "function",
443
- next: Star,
444
- blankLine: Always,
445
- },
446
- {
447
- prev: "function-overload",
448
- next: Star,
449
- blankLine: Always,
450
- },
451
- {
452
- prev: "function-overload",
453
- next: "function-overload",
454
- blankLine: Never,
455
- },
456
- {
457
- prev: "function-overload",
458
- next: "function",
459
- blankLine: Never,
460
- },
461
- {
462
- prev: ["const", "let", "var"],
463
- next: Star,
464
- blankLine: Always,
465
- },
466
- {
467
- prev: ["const", "let", "var"],
468
- next: ["const", "let", "var"],
469
- blankLine: Never,
470
- },
471
- {
472
- prev: "expression",
473
- next: Star,
474
- blankLine: Always,
475
- },
476
- {
477
- prev: "expression",
478
- next: "expression",
479
- blankLine: Never,
480
- },
481
- {
482
- prev: Star,
483
- next: [
484
- "throw",
485
- "return",
486
- "break",
487
- "continue",
488
- ],
489
- blankLine: Always,
490
- },
491
- {
492
- prev: Star,
493
- next: ["export", "cjs-export"],
494
- blankLine: Always,
495
- },
496
- {
497
- prev: ["export", "cjs-export"],
498
- next: ["export", "cjs-export"],
499
- blankLine: Never,
500
- },
501
- ],
502
- "@stylistic/quote-props": [
503
- ERROR,
504
- AsNeeded,
505
- {
506
- keywords: true,
507
- unnecessary: true,
508
- numbers: false,
509
- },
510
- ],
511
- "@stylistic/quotes": [
512
- ERROR,
513
- Double,
514
- {
515
- avoidEscape: true,
516
- allowTemplateLiterals: true,
517
- },
518
- ],
519
- "@stylistic/rest-spread-spacing": [ERROR, Never],
520
- "@stylistic/semi": [
521
- ERROR,
522
- Always,
523
- {
524
- omitLastInOneLineBlock: false,
525
- omitLastInOneLineClassBody: false,
526
- },
527
- ],
528
- "@stylistic/semi-spacing": [
529
- ERROR,
530
- {
531
- before: false,
532
- after: true,
533
- },
534
- ],
535
- "@stylistic/semi-style": [ERROR, Last],
536
- "@stylistic/space-before-blocks": [
537
- ERROR,
538
- {
539
- functions: Always,
540
- keywords: Always,
541
- classes: Always,
542
- },
543
- ],
544
- "@stylistic/space-before-function-paren": [
545
- ERROR,
546
- {
547
- anonymous: Always,
548
- named: Never,
549
- asyncArrow: Always,
550
- },
551
- ],
552
- "@stylistic/space-in-parens": [ERROR, Never],
553
- "@stylistic/space-infix-ops": [
554
- ERROR,
555
- {
556
- int32Hint: true,
557
- },
558
- ],
559
- "@stylistic/space-unary-ops": [
560
- ERROR,
561
- {
562
- words: true,
563
- nonwords: false,
564
- overrides: {},
565
- },
566
- ],
567
- "@stylistic/spaced-comment": [ERROR, Always],
568
- "@stylistic/switch-colon-spacing": [
569
- ERROR,
570
- {
571
- after: true,
572
- before: false,
573
- },
574
- ],
575
- "@stylistic/template-curly-spacing": [ERROR, Never],
576
- "@stylistic/template-tag-spacing": [ERROR, Never],
577
- "@stylistic/type-annotation-spacing": [
578
- ERROR,
579
- {
580
- before: true,
581
- after: true,
582
- overrides: {
583
- colon: {
584
- before: false,
585
- after: true,
586
- },
587
- },
588
- } /* non-overriden rule affects all type annotations (arrows, "as" keyword, "satisfies" keyword) except colons */,
589
- ],
590
- "@stylistic/type-generic-spacing": ERROR,
591
- "@stylistic/type-named-tuple-spacing": ERROR,
592
- "@stylistic/wrap-iife": [
593
- ERROR,
594
- Inside,
595
- {
596
- functionPrototypeMethods: true,
597
- },
598
- ],
599
- "@stylistic/wrap-regex": ERROR,
600
- "@stylistic/yield-star-spacing": [
601
- ERROR,
602
- {
603
- before: false,
604
- after: true,
605
- },
606
- ],
607
- },
608
- ] as const;
1
+ import { stylistic, level, state } from "../_strings.js";
2
+
3
+ const
4
+ { ERROR, OFF } = level,
5
+ {
6
+ Never,
7
+ Always,
8
+ AlwaysMultiline,
9
+ Consistent,
10
+ AsNeeded,
11
+ Strict,
12
+ All,
13
+ Star,
14
+ Last,
15
+ Before,
16
+ After,
17
+ Below,
18
+ Beside,
19
+ Inside,
20
+ Double,
21
+ } = state;
22
+
23
+ export default [
24
+ stylistic,
25
+ {
26
+ // https://eslint.style/rules
27
+ "@stylistic/array-bracket-newline": [
28
+ ERROR,
29
+ {
30
+ multiline: true,
31
+ minItems: null,
32
+ },
33
+ ],
34
+ "@stylistic/array-bracket-spacing": [
35
+ ERROR,
36
+ Never,
37
+ {
38
+ singleValue: false,
39
+ objectsInArrays: false,
40
+ arraysInArrays: false,
41
+ },
42
+ ],
43
+ "@stylistic/array-element-newline": [
44
+ ERROR,
45
+ {
46
+ ArrayExpression: {
47
+ consistent: true,
48
+ multiline: true,
49
+ minItems: 4,
50
+ },
51
+ ArrayPattern: {
52
+ consistent: true,
53
+ multiline: true,
54
+ minItems: 4,
55
+ },
56
+ },
57
+ ],
58
+ "@stylistic/arrow-parens": [
59
+ ERROR,
60
+ AsNeeded,
61
+ {
62
+ requireForBlockBody: false,
63
+ },
64
+ ],
65
+ "@stylistic/arrow-spacing": [
66
+ ERROR,
67
+ {
68
+ before: true,
69
+ after: true,
70
+ },
71
+ ],
72
+ "@stylistic/block-spacing": [ERROR, Always],
73
+ "@stylistic/brace-style": [
74
+ ERROR,
75
+ "stroustrup",
76
+ {
77
+ allowSingleLine: true,
78
+ },
79
+ ],
80
+ "@stylistic/comma-dangle": [ERROR, AlwaysMultiline],
81
+ "@stylistic/comma-spacing": [
82
+ ERROR,
83
+ {
84
+ before: false,
85
+ after: true,
86
+ },
87
+ ],
88
+ "@stylistic/comma-style": [
89
+ ERROR,
90
+ Last,
91
+ {
92
+ exceptions: {
93
+ ArrayExpression: false,
94
+ ArrayPattern: false,
95
+ ArrowFunctionExpression: false,
96
+ CallExpression: false,
97
+ FunctionDeclaration: false,
98
+ FunctionExpression: false,
99
+ ImportDeclaration: false,
100
+ ObjectExpression: false,
101
+ ObjectPattern: false,
102
+ VariableDeclaration: false,
103
+ NewExpression: false,
104
+ },
105
+ },
106
+ ],
107
+ "@stylistic/computed-property-spacing": [
108
+ ERROR,
109
+ Never,
110
+ {
111
+ enforceForClassMembers: true,
112
+ },
113
+ ],
114
+ "@stylistic/dot-location": [ERROR, "property"],
115
+ "@stylistic/eol-last": [ERROR, Always],
116
+ "@stylistic/function-call-argument-newline": [ERROR, Consistent],
117
+ "@stylistic/function-call-spacing": [ERROR, Never],
118
+
119
+ "@stylistic/function-paren-newline": [ERROR, "multiline-arguments"] /* BUG: https://github.com/eslint-stylistic/eslint-stylistic/issues/290 */,
120
+ "@stylistic/generator-star-spacing": [
121
+ ERROR,
122
+ {
123
+ before: true,
124
+ after: false,
125
+ },
126
+ ],
127
+ "@stylistic/implicit-arrow-linebreak": [ERROR, Beside],
128
+ "@stylistic/indent": [
129
+ ERROR,
130
+ 2,
131
+ {
132
+ ignoredNodes: [],
133
+ SwitchCase: 1,
134
+ VariableDeclarator: { "var": 0, let: 0, "const": 0 },
135
+ outerIIFEBody: 0,
136
+ MemberExpression: 1,
137
+ FunctionDeclaration: { parameters: 1, body: 1 },
138
+ FunctionExpression: { parameters: 1, body: 1 },
139
+ StaticBlock: { body: 1 },
140
+ CallExpression: { arguments: 1 },
141
+ ArrayExpression: 1,
142
+ ObjectExpression: 1,
143
+ ImportDeclaration: 1,
144
+ flatTernaryExpressions: false,
145
+ offsetTernaryExpressions: true,
146
+ ignoreComments: false,
147
+ },
148
+ ],
149
+ "@stylistic/indent-binary-ops": [ERROR, 2],
150
+ "@stylistic/key-spacing": [
151
+ ERROR,
152
+ {
153
+ beforeColon: false,
154
+ afterColon: true,
155
+ mode: Strict,
156
+ },
157
+ ],
158
+ "@stylistic/keyword-spacing": [
159
+ ERROR,
160
+ {
161
+ before: true,
162
+ after: true,
163
+ overrides: {},
164
+ },
165
+ ],
166
+ "@stylistic/line-comment-position": OFF,
167
+ "@stylistic/lines-around-comment": [
168
+ ERROR,
169
+ {
170
+ beforeBlockComment: false,
171
+ afterBlockComment: false,
172
+ beforeLineComment: true,
173
+ afterLineComment: false,
174
+ allowBlockStart: true,
175
+ allowBlockEnd: true,
176
+ allowObjectStart: true,
177
+ allowObjectEnd: true,
178
+ allowArrayStart: true,
179
+ allowArrayEnd: true,
180
+ allowClassStart: true,
181
+ allowClassEnd: true,
182
+ applyDefaultIgnorePatterns: true,
183
+ afterHashbangComment: false,
184
+
185
+ // TS-only
186
+ allowEnumEnd: true,
187
+ allowEnumStart: true,
188
+ allowInterfaceEnd: true,
189
+ allowInterfaceStart: true,
190
+ allowModuleEnd: true,
191
+ allowModuleStart: true,
192
+ allowTypeEnd: true,
193
+ allowTypeStart: true,
194
+ },
195
+ ],
196
+ "@stylistic/lines-between-class-members": [
197
+ ERROR,
198
+ {
199
+ enforce: [
200
+ { prev: "field", next: "field", blankLine: Never },
201
+ { prev: "field", next: "method", blankLine: Always },
202
+ { prev: "method", next: Star, blankLine: Always },
203
+ ],
204
+ },
205
+ {
206
+ exceptAfterSingleLine: false,
207
+ exceptAfterOverload: true /* TS-only */,
208
+ },
209
+ ],
210
+ "@stylistic/max-len": [
211
+ ERROR,
212
+ {
213
+ code: 150,
214
+ tabWidth: 2,
215
+ ignoreComments: true,
216
+ ignoreTrailingComments: true,
217
+ ignoreUrls: true,
218
+ ignoreStrings: true,
219
+ ignoreTemplateLiterals: true,
220
+ ignoreRegExpLiterals: true,
221
+ },
222
+ ],
223
+ "@stylistic/max-statements-per-line": [
224
+ ERROR,
225
+ {
226
+ max: 1,
227
+ },
228
+ ],
229
+ "@stylistic/member-delimiter-style": [
230
+ ERROR,
231
+ {
232
+ multiline: {
233
+ delimiter: "semi",
234
+ requireLast: true,
235
+ },
236
+ singleline: {
237
+ delimiter: "semi",
238
+ requireLast: false,
239
+ },
240
+ multilineDetection: "brackets",
241
+ },
242
+ ],
243
+ "@stylistic/multiline-comment-style": OFF,
244
+ "@stylistic/multiline-ternary": [ERROR, AlwaysMultiline],
245
+ "@stylistic/new-parens": [OFF, Never],
246
+ "@stylistic/newline-per-chained-call": [
247
+ ERROR,
248
+ {
249
+ ignoreChainWithDepth: 2,
250
+ },
251
+ ],
252
+ "@stylistic/no-confusing-arrow": OFF,
253
+ "@stylistic/no-extra-parens": [
254
+ ERROR,
255
+ All,
256
+ {
257
+ conditionalAssign: true,
258
+ returnAssign: true,
259
+ nestedBinaryExpressions: true,
260
+ ternaryOperandBinaryExpressions: true,
261
+ enforceForArrowConditionals: true,
262
+ enforceForSequenceExpressions: true,
263
+ enforceForNewInMemberExpressions: true,
264
+ enforceForFunctionPrototypeMethods: true,
265
+ },
266
+ ],
267
+ "@stylistic/no-extra-semi": ERROR,
268
+ "@stylistic/no-floating-decimal": ERROR,
269
+ "@stylistic/no-mixed-operators": OFF,
270
+ "@stylistic/no-mixed-spaces-and-tabs": ERROR,
271
+ "@stylistic/no-multi-spaces": [
272
+ ERROR,
273
+ {
274
+ ignoreEOLComments: false,
275
+ exceptions: { Property: false },
276
+ includeTabs: true,
277
+ },
278
+ ],
279
+ "@stylistic/no-multiple-empty-lines": [
280
+ ERROR,
281
+ {
282
+ max: 1,
283
+ maxEOF: 1,
284
+ maxBOF: 0,
285
+ },
286
+ ],
287
+ "@stylistic/no-tabs": [
288
+ ERROR,
289
+ {
290
+ allowIndentationTabs: false,
291
+ },
292
+ ],
293
+ "@stylistic/no-trailing-spaces": [
294
+ ERROR,
295
+ {
296
+ skipBlankLines: false,
297
+ ignoreComments: false,
298
+ },
299
+ ],
300
+ "@stylistic/no-whitespace-before-property": ERROR,
301
+ "@stylistic/nonblock-statement-body-position": [
302
+ ERROR,
303
+ Below,
304
+ {
305
+ overrides: {
306
+ "if": Below,
307
+ "else": Below,
308
+ "while": Below,
309
+ "do": Below,
310
+ "for": Below,
311
+ },
312
+ },
313
+ ],
314
+ "@stylistic/object-curly-newline": [
315
+ ERROR,
316
+ {
317
+ ObjectExpression: {
318
+ consistent: true,
319
+ multiline: true,
320
+ minProperties: 4,
321
+ },
322
+ ObjectPattern: {
323
+ consistent: true,
324
+ multiline: true,
325
+ minProperties: 4,
326
+ },
327
+ ImportDeclaration: {
328
+ consistent: true,
329
+ multiline: true,
330
+ minProperties: 4,
331
+ },
332
+ ExportDeclaration: {
333
+ consistent: true,
334
+ multiline: true,
335
+ minProperties: 4,
336
+ },
337
+ },
338
+ ],
339
+ "@stylistic/object-curly-spacing": [
340
+ ERROR,
341
+ Always,
342
+ {
343
+ arraysInObjects: true,
344
+ objectsInObjects: true,
345
+ },
346
+ ],
347
+ "@stylistic/object-property-newline": [
348
+ ERROR,
349
+ {
350
+ allowAllPropertiesOnSameLine: true,
351
+ },
352
+ ],
353
+ "@stylistic/one-var-declaration-per-line": [ERROR, Always],
354
+ "@stylistic/operator-linebreak": [
355
+ ERROR,
356
+ Before,
357
+ {
358
+ overrides: {
359
+ "=": After,
360
+ },
361
+ },
362
+ ],
363
+ "@stylistic/padded-blocks": [
364
+ ERROR,
365
+ {
366
+ blocks: Never,
367
+ classes: Never,
368
+ switches: Never,
369
+ },
370
+ {
371
+ allowSingleLineBlocks: true,
372
+ },
373
+ ],
374
+ "@stylistic/padding-line-between-statements": [
375
+ ERROR,
376
+ {
377
+ prev: "directive",
378
+ next: Star,
379
+ blankLine: Always,
380
+ },
381
+ {
382
+ prev: "directive",
383
+ next: "directive",
384
+ blankLine: Never,
385
+ },
386
+ {
387
+ prev: ["import", "cjs-import"],
388
+ next: Star,
389
+ blankLine: Always,
390
+ },
391
+ {
392
+ prev: ["import", "cjs-import"],
393
+ next: ["import", "cjs-import"],
394
+ blankLine: Never,
395
+ },
396
+ {
397
+ prev: [
398
+ "class",
399
+ "interface",
400
+ "try",
401
+ "for",
402
+ "if",
403
+ "do",
404
+ "while",
405
+ "switch",
406
+ "block",
407
+ "block-like",
408
+ "iife",
409
+ "empty",
410
+ "debugger",
411
+ "with",
412
+ ],
413
+ next: Star,
414
+ blankLine: Always,
415
+ },
416
+ {
417
+ prev: "case",
418
+ next: Star,
419
+ blankLine: Always,
420
+ },
421
+ {
422
+ prev: "case",
423
+ next: ["case", "default"],
424
+ blankLine: Always,
425
+ },
426
+ {
427
+ prev: "default",
428
+ next: Star,
429
+ blankLine: Always,
430
+ },
431
+ {
432
+ prev: "type",
433
+ next: Star,
434
+ blankLine: Always,
435
+ },
436
+ {
437
+ prev: "type",
438
+ next: "type",
439
+ blankLine: Never,
440
+ },
441
+ {
442
+ prev: "function",
443
+ next: Star,
444
+ blankLine: Always,
445
+ },
446
+ {
447
+ prev: "function-overload",
448
+ next: Star,
449
+ blankLine: Always,
450
+ },
451
+ {
452
+ prev: "function-overload",
453
+ next: "function-overload",
454
+ blankLine: Never,
455
+ },
456
+ {
457
+ prev: "function-overload",
458
+ next: "function",
459
+ blankLine: Never,
460
+ },
461
+ {
462
+ prev: ["const", "let", "var"],
463
+ next: Star,
464
+ blankLine: Always,
465
+ },
466
+ {
467
+ prev: ["const", "let", "var"],
468
+ next: ["const", "let", "var"],
469
+ blankLine: Never,
470
+ },
471
+ {
472
+ prev: "expression",
473
+ next: Star,
474
+ blankLine: Always,
475
+ },
476
+ {
477
+ prev: "expression",
478
+ next: "expression",
479
+ blankLine: Never,
480
+ },
481
+ {
482
+ prev: Star,
483
+ next: [
484
+ "throw",
485
+ "return",
486
+ "break",
487
+ "continue",
488
+ ],
489
+ blankLine: Always,
490
+ },
491
+ {
492
+ prev: Star,
493
+ next: ["export", "cjs-export"],
494
+ blankLine: Always,
495
+ },
496
+ {
497
+ prev: ["export", "cjs-export"],
498
+ next: ["export", "cjs-export"],
499
+ blankLine: Never,
500
+ },
501
+ ],
502
+ "@stylistic/quote-props": [
503
+ ERROR,
504
+ AsNeeded,
505
+ {
506
+ keywords: true,
507
+ unnecessary: true,
508
+ numbers: false,
509
+ },
510
+ ],
511
+ "@stylistic/quotes": [
512
+ ERROR,
513
+ Double,
514
+ {
515
+ avoidEscape: true,
516
+ allowTemplateLiterals: true,
517
+ },
518
+ ],
519
+ "@stylistic/rest-spread-spacing": [ERROR, Never],
520
+ "@stylistic/semi": [
521
+ ERROR,
522
+ Always,
523
+ {
524
+ omitLastInOneLineBlock: false,
525
+ omitLastInOneLineClassBody: false,
526
+ },
527
+ ],
528
+ "@stylistic/semi-spacing": [
529
+ ERROR,
530
+ {
531
+ before: false,
532
+ after: true,
533
+ },
534
+ ],
535
+ "@stylistic/semi-style": [ERROR, Last],
536
+ "@stylistic/space-before-blocks": [
537
+ ERROR,
538
+ {
539
+ functions: Always,
540
+ keywords: Always,
541
+ classes: Always,
542
+ },
543
+ ],
544
+ "@stylistic/space-before-function-paren": [
545
+ ERROR,
546
+ {
547
+ anonymous: Always,
548
+ named: Never,
549
+ asyncArrow: Always,
550
+ },
551
+ ],
552
+ "@stylistic/space-in-parens": [ERROR, Never],
553
+ "@stylistic/space-infix-ops": [
554
+ ERROR,
555
+ {
556
+ int32Hint: true,
557
+ },
558
+ ],
559
+ "@stylistic/space-unary-ops": [
560
+ ERROR,
561
+ {
562
+ words: true,
563
+ nonwords: false,
564
+ overrides: {},
565
+ },
566
+ ],
567
+ "@stylistic/spaced-comment": [ERROR, Always],
568
+ "@stylistic/switch-colon-spacing": [
569
+ ERROR,
570
+ {
571
+ after: true,
572
+ before: false,
573
+ },
574
+ ],
575
+ "@stylistic/template-curly-spacing": [ERROR, Never],
576
+ "@stylistic/template-tag-spacing": [ERROR, Never],
577
+ "@stylistic/type-annotation-spacing": [
578
+ ERROR,
579
+ {
580
+ before: true,
581
+ after: true,
582
+ overrides: {
583
+ colon: {
584
+ before: false,
585
+ after: true,
586
+ },
587
+ },
588
+ } /* non-overriden rule affects all type annotations (arrows, "as" keyword, "satisfies" keyword) except colons */,
589
+ ],
590
+ "@stylistic/type-generic-spacing": ERROR,
591
+ "@stylistic/type-named-tuple-spacing": ERROR,
592
+ "@stylistic/wrap-iife": [
593
+ ERROR,
594
+ Inside,
595
+ {
596
+ functionPrototypeMethods: true,
597
+ },
598
+ ],
599
+ "@stylistic/wrap-regex": ERROR,
600
+ "@stylistic/yield-star-spacing": [
601
+ ERROR,
602
+ {
603
+ before: false,
604
+ after: true,
605
+ },
606
+ ],
607
+ },
608
+ ] as const;