@kitschpatrol/eslint-config 4.7.12 → 5.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.
package/dist/index.js ADDED
@@ -0,0 +1,3918 @@
1
+ // src/configs/astro.ts
2
+ import globals from "globals";
3
+ import path from "node:path";
4
+ import process3 from "node:process";
5
+
6
+ // src/globs.ts
7
+ var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
8
+ var GLOB_SRC = `**/*.${GLOB_SRC_EXT}`;
9
+ var GLOB_JS = "**/*.?([cm])js";
10
+ var GLOB_JSX = "**/*.?([cm])jsx";
11
+ var GLOB_TS = "**/*.?([cm])ts";
12
+ var GLOB_TSX = "**/*.?([cm])tsx";
13
+ var GLOB_STYLE = "**/*.{c,le,sc}ss";
14
+ var GLOB_CSS = "**/*.css";
15
+ var GLOB_POSTCSS = "**/*.{p,post}css";
16
+ var GLOB_LESS = "**/*.less";
17
+ var GLOB_SCSS = "**/*.scss";
18
+ var GLOB_JSON = "**/*.json";
19
+ var GLOB_JSON5 = "**/*.json5";
20
+ var GLOB_JSONC = "**/*.jsonc";
21
+ var GLOB_MARKDOWN = "**/*.md";
22
+ var GLOB_MDX = "**/*.mdx";
23
+ var GLOB_SVELTE = "**/*.svelte";
24
+ var GLOB_YAML = "**/*.y?(a)ml";
25
+ var GLOB_TOML = "**/*.toml";
26
+ var GLOB_XML = "**/*.xml";
27
+ var GLOB_SVG = "**/*.svg";
28
+ var GLOB_HTML = "**/*.htm?(l)";
29
+ var GLOB_ASTRO = "**/*.astro";
30
+ var GLOB_ASTRO_JS = `${GLOB_ASTRO}/*.js`;
31
+ var GLOB_ASTRO_TS = `${GLOB_ASTRO}/*.ts`;
32
+ var GLOB_GRAPHQL = "**/*.{g,graph}ql";
33
+ var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
34
+ var GLOB_MDX_CODE = `${GLOB_MDX}/${GLOB_SRC}`;
35
+ var GLOB_TESTS = [
36
+ `**/__tests__/**/*.${GLOB_SRC_EXT}`,
37
+ `**/*.spec.${GLOB_SRC_EXT}`,
38
+ `**/*.test.${GLOB_SRC_EXT}`,
39
+ `**/*.bench.${GLOB_SRC_EXT}`,
40
+ `**/*.benchmark.${GLOB_SRC_EXT}`
41
+ ];
42
+ var GLOB_ALL_SRC = [
43
+ GLOB_SRC,
44
+ GLOB_STYLE,
45
+ GLOB_JSON,
46
+ GLOB_JSON5,
47
+ GLOB_MARKDOWN,
48
+ GLOB_MDX,
49
+ GLOB_SVELTE,
50
+ GLOB_YAML,
51
+ GLOB_XML,
52
+ GLOB_HTML
53
+ ];
54
+ var GLOB_EXCLUDE = [
55
+ "**/node_modules",
56
+ "**/dist",
57
+ "**/package-lock.json",
58
+ "**/yarn.lock",
59
+ "**/pnpm-lock.yaml",
60
+ "**/bun.lockb",
61
+ "**/bin",
62
+ "**/output",
63
+ "**/coverage",
64
+ "**/temp",
65
+ "**/.temp",
66
+ "**/tmp",
67
+ "**/.tmp",
68
+ "**/.history",
69
+ "**/.vitepress/cache",
70
+ "**/.nuxt",
71
+ "**/.next",
72
+ "**/.svelte-kit",
73
+ "**/.vercel",
74
+ "**/.changeset",
75
+ "**/.idea",
76
+ "**/.cache",
77
+ "**/.output",
78
+ "**/.vite-inspect",
79
+ "**/.yarn",
80
+ "**/vite.config.*.timestamp-*",
81
+ "**/CHANGELOG*.md",
82
+ "**/*.min.*",
83
+ "**/LICENSE*",
84
+ "**/__snapshots__",
85
+ "**/auto-import?(s).d.ts",
86
+ "**/components.d.ts"
87
+ ];
88
+
89
+ // src/parsers.ts
90
+ import * as tsParser from "@typescript-eslint/parser";
91
+
92
+ // src/presets/astro.ts
93
+ var astroRecommendedRules = {
94
+ // Brittle since there's no negative index access in dot-prop
95
+ // Begin expansion 'eslint-plugin-astro' 'flat/recommended[4]'
96
+ "astro/missing-client-only-directive-value": "error",
97
+ "astro/no-conflict-set-directives": "error",
98
+ "astro/no-deprecated-astro-canonicalurl": "error",
99
+ "astro/no-deprecated-astro-fetchcontent": "error",
100
+ "astro/no-deprecated-astro-resolve": "error",
101
+ "astro/no-deprecated-getentrybyslug": "error",
102
+ "astro/no-unused-define-vars-in-style": "error",
103
+ "astro/valid-compile": "error"
104
+ // End expansion
105
+ };
106
+ var astroJsxA11yRecommendedRules = {
107
+ // Brittle since there's no negative index access in dot-prop
108
+ // Begin expansion 'eslint-plugin-astro' 'flat/jsx-a11y-recommended[4]'
109
+ "astro/jsx-a11y/alt-text": "error",
110
+ "astro/jsx-a11y/anchor-ambiguous-text": "off",
111
+ "astro/jsx-a11y/anchor-has-content": "error",
112
+ "astro/jsx-a11y/anchor-is-valid": "error",
113
+ "astro/jsx-a11y/aria-activedescendant-has-tabindex": "error",
114
+ "astro/jsx-a11y/aria-props": "error",
115
+ "astro/jsx-a11y/aria-proptypes": "error",
116
+ "astro/jsx-a11y/aria-role": "error",
117
+ "astro/jsx-a11y/aria-unsupported-elements": "error",
118
+ "astro/jsx-a11y/autocomplete-valid": "error",
119
+ "astro/jsx-a11y/click-events-have-key-events": "error",
120
+ "astro/jsx-a11y/control-has-associated-label": [
121
+ "off",
122
+ {
123
+ ignoreElements: ["audio", "canvas", "embed", "input", "textarea", "tr", "video"],
124
+ ignoreRoles: [
125
+ "grid",
126
+ "listbox",
127
+ "menu",
128
+ "menubar",
129
+ "radiogroup",
130
+ "row",
131
+ "tablist",
132
+ "toolbar",
133
+ "tree",
134
+ "treegrid"
135
+ ],
136
+ includeRoles: ["alert", "dialog"]
137
+ }
138
+ ],
139
+ "astro/jsx-a11y/heading-has-content": "error",
140
+ "astro/jsx-a11y/html-has-lang": "error",
141
+ "astro/jsx-a11y/iframe-has-title": "error",
142
+ "astro/jsx-a11y/img-redundant-alt": "error",
143
+ "astro/jsx-a11y/interactive-supports-focus": [
144
+ "error",
145
+ { tabbable: ["button", "checkbox", "link", "searchbox", "spinbutton", "switch", "textbox"] }
146
+ ],
147
+ "astro/jsx-a11y/label-has-associated-control": "error",
148
+ // "astro/jsx-a11y/label-has-for":"off",
149
+ "astro/jsx-a11y/media-has-caption": "error",
150
+ "astro/jsx-a11y/mouse-events-have-key-events": "error",
151
+ "astro/jsx-a11y/no-access-key": "error",
152
+ "astro/jsx-a11y/no-autofocus": "error",
153
+ "astro/jsx-a11y/no-distracting-elements": "error",
154
+ "astro/jsx-a11y/no-interactive-element-to-noninteractive-role": [
155
+ "error",
156
+ { tr: ["none", "presentation"], canvas: ["img"] }
157
+ ],
158
+ "astro/jsx-a11y/no-noninteractive-element-interactions": [
159
+ "error",
160
+ {
161
+ handlers: [
162
+ "onClick",
163
+ "onError",
164
+ "onLoad",
165
+ "onMouseDown",
166
+ "onMouseUp",
167
+ "onKeyPress",
168
+ "onKeyDown",
169
+ "onKeyUp"
170
+ ],
171
+ alert: ["onKeyUp", "onKeyDown", "onKeyPress"],
172
+ body: ["onError", "onLoad"],
173
+ dialog: ["onKeyUp", "onKeyDown", "onKeyPress"],
174
+ iframe: ["onError", "onLoad"],
175
+ img: ["onError", "onLoad"]
176
+ }
177
+ ],
178
+ "astro/jsx-a11y/no-noninteractive-element-to-interactive-role": [
179
+ "error",
180
+ {
181
+ ul: ["listbox", "menu", "menubar", "radiogroup", "tablist", "tree", "treegrid"],
182
+ ol: ["listbox", "menu", "menubar", "radiogroup", "tablist", "tree", "treegrid"],
183
+ li: ["menuitem", "menuitemradio", "menuitemcheckbox", "option", "row", "tab", "treeitem"],
184
+ table: ["grid"],
185
+ td: ["gridcell"],
186
+ fieldset: ["radiogroup", "presentation"]
187
+ }
188
+ ],
189
+ "astro/jsx-a11y/no-noninteractive-tabindex": [
190
+ "error",
191
+ { tags: [], roles: ["tabpanel"], allowExpressionValues: true }
192
+ ],
193
+ "astro/jsx-a11y/no-redundant-roles": "error",
194
+ "astro/jsx-a11y/no-static-element-interactions": [
195
+ "error",
196
+ {
197
+ allowExpressionValues: true,
198
+ handlers: ["onClick", "onMouseDown", "onMouseUp", "onKeyPress", "onKeyDown", "onKeyUp"]
199
+ }
200
+ ],
201
+ "astro/jsx-a11y/role-has-required-aria-props": "error",
202
+ "astro/jsx-a11y/role-supports-aria-props": "error",
203
+ "astro/jsx-a11y/scope": "error",
204
+ "astro/jsx-a11y/tabindex-no-positive": "error"
205
+ // End expansion
206
+ };
207
+
208
+ // src/presets/depend.ts
209
+ var dependRecommendedRules = {
210
+ // Begin expansion 'eslint-plugin-depend' 'recommended'
211
+ "depend/ban-dependencies": "error"
212
+ // End expansion
213
+ };
214
+
215
+ // src/presets/eslint-comments.ts
216
+ var eslintCommentsRecommendedRules = {
217
+ // Begin expansion '@eslint-community/eslint-plugin-eslint-comments' 'recommended'
218
+ "eslint-comments/disable-enable-pair": "error",
219
+ "eslint-comments/no-aggregating-enable": "error",
220
+ "eslint-comments/no-duplicate-disable": "error",
221
+ "eslint-comments/no-unlimited-disable": "error",
222
+ "eslint-comments/no-unused-enable": "error"
223
+ // End expansion
224
+ };
225
+
226
+ // src/presets/eslint-javascript.ts
227
+ var eslintJavascriptRecommendedRules = {
228
+ // Begin expansion '@eslint/js' 'recommended'
229
+ "constructor-super": "error",
230
+ "for-direction": "error",
231
+ "getter-return": "error",
232
+ "no-async-promise-executor": "error",
233
+ "no-case-declarations": "error",
234
+ "no-class-assign": "error",
235
+ "no-compare-neg-zero": "error",
236
+ "no-cond-assign": "error",
237
+ "no-const-assign": "error",
238
+ "no-constant-binary-expression": "error",
239
+ "no-constant-condition": "error",
240
+ "no-control-regex": "error",
241
+ "no-debugger": "error",
242
+ "no-delete-var": "error",
243
+ "no-dupe-args": "error",
244
+ "no-dupe-class-members": "error",
245
+ "no-dupe-else-if": "error",
246
+ "no-dupe-keys": "error",
247
+ "no-duplicate-case": "error",
248
+ "no-empty": "error",
249
+ "no-empty-character-class": "error",
250
+ "no-empty-pattern": "error",
251
+ "no-empty-static-block": "error",
252
+ "no-ex-assign": "error",
253
+ "no-extra-boolean-cast": "error",
254
+ "no-fallthrough": "error",
255
+ "no-func-assign": "error",
256
+ "no-global-assign": "error",
257
+ "no-import-assign": "error",
258
+ "no-invalid-regexp": "error",
259
+ "no-irregular-whitespace": "error",
260
+ "no-loss-of-precision": "error",
261
+ "no-misleading-character-class": "error",
262
+ "no-new-native-nonconstructor": "error",
263
+ "no-nonoctal-decimal-escape": "error",
264
+ "no-obj-calls": "error",
265
+ "no-octal": "error",
266
+ "no-prototype-builtins": "error",
267
+ "no-redeclare": "error",
268
+ "no-regex-spaces": "error",
269
+ "no-self-assign": "error",
270
+ "no-setter-return": "error",
271
+ "no-shadow-restricted-names": "error",
272
+ "no-sparse-arrays": "error",
273
+ "no-this-before-super": "error",
274
+ "no-undef": "error",
275
+ "no-unexpected-multiline": "error",
276
+ "no-unreachable": "error",
277
+ "no-unsafe-finally": "error",
278
+ "no-unsafe-negation": "error",
279
+ "no-unsafe-optional-chaining": "error",
280
+ "no-unused-labels": "error",
281
+ "no-unused-private-class-members": "error",
282
+ "no-unused-vars": "error",
283
+ "no-useless-backreference": "error",
284
+ "no-useless-catch": "error",
285
+ "no-useless-escape": "error",
286
+ "no-with": "error",
287
+ "require-yield": "error",
288
+ "use-isnan": "error",
289
+ "valid-typeof": "error"
290
+ // End expansion
291
+ };
292
+
293
+ // src/presets/eslint-typescript.ts
294
+ var eslintTypescriptRecommendedOverridesRules = {
295
+ // Begin expansion '@typescript-eslint/eslint-plugin' 'eslint-recommended.overrides[0]'
296
+ "constructor-super": "off",
297
+ "getter-return": "off",
298
+ "no-class-assign": "off",
299
+ "no-const-assign": "off",
300
+ "no-dupe-args": "off",
301
+ "no-dupe-class-members": "off",
302
+ "no-dupe-keys": "off",
303
+ "no-func-assign": "off",
304
+ "no-import-assign": "off",
305
+ "no-new-symbol": "off",
306
+ "no-new-native-nonconstructor": "off",
307
+ "no-obj-calls": "off",
308
+ "no-redeclare": "off",
309
+ "no-setter-return": "off",
310
+ "no-this-before-super": "off",
311
+ "no-undef": "off",
312
+ "no-unreachable": "off",
313
+ "no-unsafe-negation": "off",
314
+ "no-var": "error",
315
+ "prefer-const": "error",
316
+ "prefer-rest-params": "error",
317
+ "prefer-spread": "error"
318
+ // End expansion
319
+ };
320
+ var eslintTypescriptStrictTypeCheckedRules = {
321
+ // Begin expansion '@typescript-eslint/eslint-plugin' 'strict-type-checked'
322
+ "ts/await-thenable": "error",
323
+ "ts/ban-ts-comment": ["error", { minimumDescriptionLength: 10 }],
324
+ "no-array-constructor": "off",
325
+ "ts/no-array-constructor": "error",
326
+ "ts/no-array-delete": "error",
327
+ "ts/no-base-to-string": "error",
328
+ "ts/no-confusing-void-expression": "error",
329
+ "ts/no-deprecated": "error",
330
+ "ts/no-duplicate-enum-values": "error",
331
+ "ts/no-duplicate-type-constituents": "error",
332
+ "ts/no-dynamic-delete": "error",
333
+ "ts/no-empty-object-type": "error",
334
+ "ts/no-explicit-any": "error",
335
+ "ts/no-extra-non-null-assertion": "error",
336
+ "ts/no-extraneous-class": "error",
337
+ "ts/no-floating-promises": "error",
338
+ "ts/no-for-in-array": "error",
339
+ "no-implied-eval": "off",
340
+ "ts/no-implied-eval": "error",
341
+ "ts/no-invalid-void-type": "error",
342
+ "ts/no-meaningless-void-operator": "error",
343
+ "ts/no-misused-new": "error",
344
+ "ts/no-misused-promises": "error",
345
+ "ts/no-misused-spread": "error",
346
+ "ts/no-mixed-enums": "error",
347
+ "ts/no-namespace": "error",
348
+ "ts/no-non-null-asserted-nullish-coalescing": "error",
349
+ "ts/no-non-null-asserted-optional-chain": "error",
350
+ "ts/no-non-null-assertion": "error",
351
+ "ts/no-redundant-type-constituents": "error",
352
+ "ts/no-require-imports": "error",
353
+ "ts/no-this-alias": "error",
354
+ "ts/no-unnecessary-boolean-literal-compare": "error",
355
+ "ts/no-unnecessary-condition": "error",
356
+ "ts/no-unnecessary-template-expression": "error",
357
+ "ts/no-unnecessary-type-arguments": "error",
358
+ "ts/no-unnecessary-type-assertion": "error",
359
+ "ts/no-unnecessary-type-constraint": "error",
360
+ "ts/no-unnecessary-type-parameters": "error",
361
+ "ts/no-unsafe-argument": "error",
362
+ "ts/no-unsafe-assignment": "error",
363
+ "ts/no-unsafe-call": "error",
364
+ "ts/no-unsafe-declaration-merging": "error",
365
+ "ts/no-unsafe-enum-comparison": "error",
366
+ "ts/no-unsafe-function-type": "error",
367
+ "ts/no-unsafe-member-access": "error",
368
+ "ts/no-unsafe-return": "error",
369
+ "ts/no-unsafe-unary-minus": "error",
370
+ "no-unused-expressions": "off",
371
+ "ts/no-unused-expressions": "error",
372
+ "no-unused-vars": "off",
373
+ "ts/no-unused-vars": "error",
374
+ "no-useless-constructor": "off",
375
+ "ts/no-useless-constructor": "error",
376
+ "ts/no-wrapper-object-types": "error",
377
+ "no-throw-literal": "off",
378
+ "ts/only-throw-error": "error",
379
+ "ts/prefer-as-const": "error",
380
+ "ts/prefer-literal-enum-member": "error",
381
+ "ts/prefer-namespace-keyword": "error",
382
+ "prefer-promise-reject-errors": "off",
383
+ "ts/prefer-promise-reject-errors": "error",
384
+ "ts/prefer-reduce-type-parameter": "error",
385
+ "ts/prefer-return-this-type": "error",
386
+ "ts/related-getter-setter-pairs": "error",
387
+ "require-await": "off",
388
+ "ts/require-await": "error",
389
+ "ts/restrict-plus-operands": [
390
+ "error",
391
+ {
392
+ allowAny: false,
393
+ allowBoolean: false,
394
+ allowNullish: false,
395
+ allowNumberAndString: false,
396
+ allowRegExp: false
397
+ }
398
+ ],
399
+ "ts/restrict-template-expressions": [
400
+ "error",
401
+ {
402
+ allowAny: false,
403
+ allowBoolean: false,
404
+ allowNever: false,
405
+ allowNullish: false,
406
+ allowNumber: false,
407
+ allowRegExp: false
408
+ }
409
+ ],
410
+ "no-return-await": "off",
411
+ "ts/return-await": ["error", "error-handling-correctness-only"],
412
+ "ts/triple-slash-reference": "error",
413
+ "ts/unbound-method": "error",
414
+ "ts/unified-signatures": "error",
415
+ "ts/use-unknown-in-catch-callback-variable": "error"
416
+ // End expansion
417
+ };
418
+ var eslintTypescriptStylisticTypeCheckedRules = {
419
+ // Begin expansion '@typescript-eslint/eslint-plugin' 'stylistic-type-checked'
420
+ "ts/adjacent-overload-signatures": "error",
421
+ "ts/array-type": "error",
422
+ "ts/ban-tslint-comment": "error",
423
+ "ts/class-literal-property-style": "error",
424
+ "ts/consistent-generic-constructors": "error",
425
+ "ts/consistent-indexed-object-style": "error",
426
+ "ts/consistent-type-assertions": "error",
427
+ "ts/consistent-type-definitions": "error",
428
+ "dot-notation": "off",
429
+ "ts/dot-notation": "error",
430
+ "ts/no-confusing-non-null-assertion": "error",
431
+ "no-empty-function": "off",
432
+ "ts/no-empty-function": "error",
433
+ "ts/no-inferrable-types": "error",
434
+ "ts/non-nullable-type-assertion-style": "error",
435
+ "ts/prefer-find": "error",
436
+ "ts/prefer-for-of": "error",
437
+ "ts/prefer-function-type": "error",
438
+ "ts/prefer-includes": "error",
439
+ "ts/prefer-nullish-coalescing": "error",
440
+ "ts/prefer-optional-chain": "error",
441
+ "ts/prefer-regexp-exec": "error",
442
+ "ts/prefer-string-starts-ends-with": "error"
443
+ // End expansion
444
+ };
445
+ var eslintTypescriptDisableTypeCheckedRules = {
446
+ // Begin expansion '@typescript-eslint/eslint-plugin' 'disable-type-checked'
447
+ "ts/await-thenable": "off",
448
+ "ts/consistent-return": "off",
449
+ "ts/consistent-type-exports": "off",
450
+ "ts/dot-notation": "off",
451
+ "ts/naming-convention": "off",
452
+ "ts/no-array-delete": "off",
453
+ "ts/no-base-to-string": "off",
454
+ "ts/no-confusing-void-expression": "off",
455
+ "ts/no-deprecated": "off",
456
+ "ts/no-duplicate-type-constituents": "off",
457
+ "ts/no-floating-promises": "off",
458
+ "ts/no-for-in-array": "off",
459
+ "ts/no-implied-eval": "off",
460
+ "ts/no-meaningless-void-operator": "off",
461
+ "ts/no-misused-promises": "off",
462
+ "ts/no-misused-spread": "off",
463
+ "ts/no-mixed-enums": "off",
464
+ "ts/no-redundant-type-constituents": "off",
465
+ "ts/no-unnecessary-boolean-literal-compare": "off",
466
+ "ts/no-unnecessary-condition": "off",
467
+ "ts/no-unnecessary-qualifier": "off",
468
+ "ts/no-unnecessary-template-expression": "off",
469
+ "ts/no-unnecessary-type-arguments": "off",
470
+ "ts/no-unnecessary-type-assertion": "off",
471
+ "ts/no-unnecessary-type-parameters": "off",
472
+ "ts/no-unsafe-argument": "off",
473
+ "ts/no-unsafe-assignment": "off",
474
+ "ts/no-unsafe-call": "off",
475
+ "ts/no-unsafe-enum-comparison": "off",
476
+ "ts/no-unsafe-member-access": "off",
477
+ "ts/no-unsafe-return": "off",
478
+ "ts/no-unsafe-type-assertion": "off",
479
+ "ts/no-unsafe-unary-minus": "off",
480
+ "ts/non-nullable-type-assertion-style": "off",
481
+ "ts/only-throw-error": "off",
482
+ "ts/prefer-destructuring": "off",
483
+ "ts/prefer-find": "off",
484
+ "ts/prefer-includes": "off",
485
+ "ts/prefer-nullish-coalescing": "off",
486
+ "ts/prefer-optional-chain": "off",
487
+ "ts/prefer-promise-reject-errors": "off",
488
+ "ts/prefer-readonly": "off",
489
+ "ts/prefer-readonly-parameter-types": "off",
490
+ "ts/prefer-reduce-type-parameter": "off",
491
+ "ts/prefer-regexp-exec": "off",
492
+ "ts/prefer-return-this-type": "off",
493
+ "ts/prefer-string-starts-ends-with": "off",
494
+ "ts/promise-function-async": "off",
495
+ "ts/related-getter-setter-pairs": "off",
496
+ "ts/require-array-sort-compare": "off",
497
+ "ts/require-await": "off",
498
+ "ts/restrict-plus-operands": "off",
499
+ "ts/restrict-template-expressions": "off",
500
+ "ts/return-await": "off",
501
+ "ts/strict-boolean-expressions": "off",
502
+ "ts/switch-exhaustiveness-check": "off",
503
+ "ts/unbound-method": "off",
504
+ "ts/use-unknown-in-catch-callback-variable": "off"
505
+ // End expansion
506
+ };
507
+
508
+ // src/presets/import.ts
509
+ var importRecommendedRules = {
510
+ // Begin expansion 'eslint-plugin-import-x' 'recommended'
511
+ "import/no-unresolved": "error",
512
+ "import/named": "error",
513
+ "import/namespace": "error",
514
+ "import/default": "error",
515
+ "import/export": "error",
516
+ "import/no-named-as-default": "warn",
517
+ "import/no-named-as-default-member": "warn",
518
+ "import/no-duplicates": "warn"
519
+ // End expansion
520
+ };
521
+ var importTypescriptRules = {
522
+ // Begin expansion 'eslint-plugin-import-x' 'typescript'
523
+ "import/named": "off"
524
+ // End expansion
525
+ };
526
+
527
+ // src/presets/jsdoc.ts
528
+ var jsdocCommentsRecommendedTypescriptFlavorRules = {
529
+ // Begin expansion 'eslint-plugin-jsdoc' 'flat/recommended-typescript-flavor'
530
+ "jsdoc/check-access": "warn",
531
+ "jsdoc/check-alignment": "warn",
532
+ "jsdoc/check-examples": "off",
533
+ "jsdoc/check-indentation": "off",
534
+ "jsdoc/check-line-alignment": "off",
535
+ "jsdoc/check-param-names": "warn",
536
+ "jsdoc/check-property-names": "warn",
537
+ "jsdoc/check-syntax": "off",
538
+ "jsdoc/check-tag-names": "warn",
539
+ "jsdoc/check-template-names": "off",
540
+ "jsdoc/check-types": "warn",
541
+ "jsdoc/check-values": "warn",
542
+ "jsdoc/convert-to-jsdoc-comments": "off",
543
+ "jsdoc/empty-tags": "warn",
544
+ "jsdoc/implements-on-classes": "warn",
545
+ "jsdoc/imports-as-dependencies": "off",
546
+ "jsdoc/informative-docs": "off",
547
+ "jsdoc/lines-before-block": "off",
548
+ "jsdoc/match-description": "off",
549
+ "jsdoc/match-name": "off",
550
+ "jsdoc/multiline-blocks": "warn",
551
+ "jsdoc/no-bad-blocks": "off",
552
+ "jsdoc/no-blank-block-descriptions": "off",
553
+ "jsdoc/no-blank-blocks": "off",
554
+ "jsdoc/no-defaults": "warn",
555
+ "jsdoc/no-missing-syntax": "off",
556
+ "jsdoc/no-multi-asterisks": "warn",
557
+ "jsdoc/no-restricted-syntax": "off",
558
+ "jsdoc/no-types": "off",
559
+ "jsdoc/no-undefined-types": "off",
560
+ "jsdoc/require-asterisk-prefix": "off",
561
+ "jsdoc/require-description": "off",
562
+ "jsdoc/require-description-complete-sentence": "off",
563
+ "jsdoc/require-example": "off",
564
+ "jsdoc/require-file-overview": "off",
565
+ "jsdoc/require-hyphen-before-param-description": "off",
566
+ "jsdoc/require-jsdoc": "warn",
567
+ "jsdoc/require-param": "warn",
568
+ "jsdoc/require-param-description": "warn",
569
+ "jsdoc/require-param-name": "warn",
570
+ "jsdoc/require-param-type": "warn",
571
+ "jsdoc/require-property": "warn",
572
+ "jsdoc/require-property-description": "warn",
573
+ "jsdoc/require-property-name": "warn",
574
+ "jsdoc/require-property-type": "warn",
575
+ "jsdoc/require-returns": "warn",
576
+ "jsdoc/require-returns-check": "warn",
577
+ "jsdoc/require-returns-description": "warn",
578
+ "jsdoc/require-returns-type": "warn",
579
+ "jsdoc/require-template": "off",
580
+ "jsdoc/require-throws": "off",
581
+ "jsdoc/require-yields": "warn",
582
+ "jsdoc/require-yields-check": "warn",
583
+ "jsdoc/sort-tags": "off",
584
+ "jsdoc/tag-lines": "warn",
585
+ "jsdoc/text-escaping": "off",
586
+ "jsdoc/valid-types": "warn"
587
+ // End expansion
588
+ };
589
+ var jsdocCommentsRecommendedTypescriptRules = {
590
+ // Begin expansion 'eslint-plugin-jsdoc' 'flat/recommended-typescript'
591
+ "jsdoc/check-access": "warn",
592
+ "jsdoc/check-alignment": "warn",
593
+ "jsdoc/check-examples": "off",
594
+ "jsdoc/check-indentation": "off",
595
+ "jsdoc/check-line-alignment": "off",
596
+ "jsdoc/check-param-names": "warn",
597
+ "jsdoc/check-property-names": "warn",
598
+ "jsdoc/check-syntax": "off",
599
+ "jsdoc/check-tag-names": ["warn", { typed: true }],
600
+ "jsdoc/check-template-names": "off",
601
+ "jsdoc/check-types": "warn",
602
+ "jsdoc/check-values": "warn",
603
+ "jsdoc/convert-to-jsdoc-comments": "off",
604
+ "jsdoc/empty-tags": "warn",
605
+ "jsdoc/implements-on-classes": "warn",
606
+ "jsdoc/imports-as-dependencies": "off",
607
+ "jsdoc/informative-docs": "off",
608
+ "jsdoc/lines-before-block": "off",
609
+ "jsdoc/match-description": "off",
610
+ "jsdoc/match-name": "off",
611
+ "jsdoc/multiline-blocks": "warn",
612
+ "jsdoc/no-bad-blocks": "off",
613
+ "jsdoc/no-blank-block-descriptions": "off",
614
+ "jsdoc/no-blank-blocks": "off",
615
+ "jsdoc/no-defaults": "warn",
616
+ "jsdoc/no-missing-syntax": "off",
617
+ "jsdoc/no-multi-asterisks": "warn",
618
+ "jsdoc/no-restricted-syntax": "off",
619
+ "jsdoc/no-types": "warn",
620
+ "jsdoc/no-undefined-types": "off",
621
+ "jsdoc/require-asterisk-prefix": "off",
622
+ "jsdoc/require-description": "off",
623
+ "jsdoc/require-description-complete-sentence": "off",
624
+ "jsdoc/require-example": "off",
625
+ "jsdoc/require-file-overview": "off",
626
+ "jsdoc/require-hyphen-before-param-description": "off",
627
+ "jsdoc/require-jsdoc": "warn",
628
+ "jsdoc/require-param": "warn",
629
+ "jsdoc/require-param-description": "warn",
630
+ "jsdoc/require-param-name": "warn",
631
+ "jsdoc/require-param-type": "off",
632
+ "jsdoc/require-property": "warn",
633
+ "jsdoc/require-property-description": "warn",
634
+ "jsdoc/require-property-name": "warn",
635
+ "jsdoc/require-property-type": "off",
636
+ "jsdoc/require-returns": "warn",
637
+ "jsdoc/require-returns-check": "warn",
638
+ "jsdoc/require-returns-description": "warn",
639
+ "jsdoc/require-returns-type": "off",
640
+ "jsdoc/require-template": "off",
641
+ "jsdoc/require-throws": "off",
642
+ "jsdoc/require-yields": "warn",
643
+ "jsdoc/require-yields-check": "warn",
644
+ "jsdoc/sort-tags": "off",
645
+ "jsdoc/tag-lines": "warn",
646
+ "jsdoc/text-escaping": "off",
647
+ "jsdoc/valid-types": "warn"
648
+ // End expansion
649
+ };
650
+
651
+ // src/presets/json.ts
652
+ var jsonRecommendedWithJsonCommonRules = {
653
+ // Begin expansion 'eslint-plugin-jsonc' 'flat/recommended-with-json[1]'
654
+ strict: "off",
655
+ "no-unused-expressions": "off",
656
+ "no-unused-vars": "off"
657
+ // End expansion
658
+ };
659
+ var jsonRecommendedWithJsonRules = {
660
+ // Begin expansion 'eslint-plugin-jsonc' 'flat/recommended-with-json[2]'
661
+ "json/comma-dangle": "error",
662
+ "json/no-bigint-literals": "error",
663
+ "json/no-binary-expression": "error",
664
+ "json/no-binary-numeric-literals": "error",
665
+ "json/no-comments": "error",
666
+ "json/no-dupe-keys": "error",
667
+ "json/no-escape-sequence-in-identifier": "error",
668
+ "json/no-floating-decimal": "error",
669
+ "json/no-hexadecimal-numeric-literals": "error",
670
+ "json/no-infinity": "error",
671
+ "json/no-multi-str": "error",
672
+ "json/no-nan": "error",
673
+ "json/no-number-props": "error",
674
+ "json/no-numeric-separators": "error",
675
+ "json/no-octal-numeric-literals": "error",
676
+ "json/no-octal": "error",
677
+ "json/no-parenthesized": "error",
678
+ "json/no-plus-sign": "error",
679
+ "json/no-regexp-literals": "error",
680
+ "json/no-sparse-arrays": "error",
681
+ "json/no-template-literals": "error",
682
+ "json/no-undefined-value": "error",
683
+ "json/no-unicode-codepoint-escapes": "error",
684
+ "json/no-useless-escape": "error",
685
+ "json/quote-props": "error",
686
+ "json/quotes": "error",
687
+ "json/space-unary-ops": "error",
688
+ "json/valid-json-number": "error",
689
+ "json/vue-custom-block/no-parsing-error": "error"
690
+ // End expansion
691
+ };
692
+ var jsonRecommendedWithJsoncRules = {
693
+ // Begin expansion 'eslint-plugin-jsonc' 'flat/recommended-with-jsonc[2]'
694
+ "json/no-bigint-literals": "error",
695
+ "json/no-binary-expression": "error",
696
+ "json/no-binary-numeric-literals": "error",
697
+ "json/no-dupe-keys": "error",
698
+ "json/no-escape-sequence-in-identifier": "error",
699
+ "json/no-floating-decimal": "error",
700
+ "json/no-hexadecimal-numeric-literals": "error",
701
+ "json/no-infinity": "error",
702
+ "json/no-multi-str": "error",
703
+ "json/no-nan": "error",
704
+ "json/no-number-props": "error",
705
+ "json/no-numeric-separators": "error",
706
+ "json/no-octal-numeric-literals": "error",
707
+ "json/no-octal": "error",
708
+ "json/no-parenthesized": "error",
709
+ "json/no-plus-sign": "error",
710
+ "json/no-regexp-literals": "error",
711
+ "json/no-sparse-arrays": "error",
712
+ "json/no-template-literals": "error",
713
+ "json/no-undefined-value": "error",
714
+ "json/no-unicode-codepoint-escapes": "error",
715
+ "json/no-useless-escape": "error",
716
+ "json/quote-props": "error",
717
+ "json/quotes": "error",
718
+ "json/space-unary-ops": "error",
719
+ "json/valid-json-number": "error",
720
+ "json/vue-custom-block/no-parsing-error": "error"
721
+ // End expansion
722
+ };
723
+ var jsonRecommendedWithJson5Rules = {
724
+ // Begin expansion 'eslint-plugin-jsonc' 'flat/recommended-with-json5[2]'
725
+ "json/no-bigint-literals": "error",
726
+ "json/no-binary-expression": "error",
727
+ "json/no-binary-numeric-literals": "error",
728
+ "json/no-dupe-keys": "error",
729
+ "json/no-escape-sequence-in-identifier": "error",
730
+ "json/no-number-props": "error",
731
+ "json/no-numeric-separators": "error",
732
+ "json/no-octal-numeric-literals": "error",
733
+ "json/no-octal": "error",
734
+ "json/no-parenthesized": "error",
735
+ "json/no-regexp-literals": "error",
736
+ "json/no-sparse-arrays": "error",
737
+ "json/no-template-literals": "error",
738
+ "json/no-undefined-value": "error",
739
+ "json/no-unicode-codepoint-escapes": "error",
740
+ "json/no-useless-escape": "error",
741
+ "json/space-unary-ops": "error",
742
+ "json/vue-custom-block/no-parsing-error": "error"
743
+ // End expansion
744
+ };
745
+ var jsonPrettierRules = {
746
+ // Begin expansion 'eslint-plugin-jsonc' 'flat/prettier[2]'
747
+ "json/array-bracket-newline": "off",
748
+ "json/array-bracket-spacing": "off",
749
+ "json/array-element-newline": "off",
750
+ "json/comma-dangle": "off",
751
+ "json/comma-style": "off",
752
+ "json/indent": "off",
753
+ "json/key-spacing": "off",
754
+ "json/no-floating-decimal": "off",
755
+ "json/object-curly-newline": "off",
756
+ "json/object-curly-spacing": "off",
757
+ "json/object-property-newline": "off",
758
+ "json/quote-props": "off",
759
+ "json/quotes": "off",
760
+ "json/space-unary-ops": "off"
761
+ // End expansion
762
+ };
763
+
764
+ // src/presets/json-package.ts
765
+ var jsonPackageRecommendedRules = {
766
+ // Begin expansion 'eslint-plugin-package-json/configs/recommended' 'rules'
767
+ "json-package/no-empty-fields": "error",
768
+ "json-package/order-properties": "error",
769
+ "json-package/require-version": "error",
770
+ "json-package/repository-shorthand": "error",
771
+ "json-package/sort-collections": "error",
772
+ "json-package/unique-dependencies": "error",
773
+ "json-package/valid-local-dependency": "error",
774
+ "json-package/valid-name": "error",
775
+ "json-package/valid-package-definition": "error",
776
+ "json-package/valid-repository-directory": "error",
777
+ "json-package/valid-version": "error"
778
+ // End expansion
779
+ };
780
+
781
+ // src/presets/jsx.ts
782
+ var jsxA11yRecommendedRules = {
783
+ // Begin expansion 'eslint-plugin-jsx-a11y' 'flatConfigs.recommended.rules'
784
+ "jsx-a11y/alt-text": "error",
785
+ "jsx-a11y/anchor-ambiguous-text": "off",
786
+ "jsx-a11y/anchor-has-content": "error",
787
+ "jsx-a11y/anchor-is-valid": "error",
788
+ "jsx-a11y/aria-activedescendant-has-tabindex": "error",
789
+ "jsx-a11y/aria-props": "error",
790
+ "jsx-a11y/aria-proptypes": "error",
791
+ "jsx-a11y/aria-role": "error",
792
+ "jsx-a11y/aria-unsupported-elements": "error",
793
+ "jsx-a11y/autocomplete-valid": "error",
794
+ "jsx-a11y/click-events-have-key-events": "error",
795
+ "jsx-a11y/control-has-associated-label": [
796
+ "off",
797
+ {
798
+ ignoreElements: ["audio", "canvas", "embed", "input", "textarea", "tr", "video"],
799
+ ignoreRoles: [
800
+ "grid",
801
+ "listbox",
802
+ "menu",
803
+ "menubar",
804
+ "radiogroup",
805
+ "row",
806
+ "tablist",
807
+ "toolbar",
808
+ "tree",
809
+ "treegrid"
810
+ ],
811
+ includeRoles: ["alert", "dialog"]
812
+ }
813
+ ],
814
+ "jsx-a11y/heading-has-content": "error",
815
+ "jsx-a11y/html-has-lang": "error",
816
+ "jsx-a11y/iframe-has-title": "error",
817
+ "jsx-a11y/img-redundant-alt": "error",
818
+ "jsx-a11y/interactive-supports-focus": [
819
+ "error",
820
+ { tabbable: ["button", "checkbox", "link", "searchbox", "spinbutton", "switch", "textbox"] }
821
+ ],
822
+ "jsx-a11y/label-has-associated-control": "error",
823
+ "jsx-a11y/label-has-for": "off",
824
+ "jsx-a11y/media-has-caption": "error",
825
+ "jsx-a11y/mouse-events-have-key-events": "error",
826
+ "jsx-a11y/no-access-key": "error",
827
+ "jsx-a11y/no-autofocus": "error",
828
+ "jsx-a11y/no-distracting-elements": "error",
829
+ "jsx-a11y/no-interactive-element-to-noninteractive-role": [
830
+ "error",
831
+ { tr: ["none", "presentation"], canvas: ["img"] }
832
+ ],
833
+ "jsx-a11y/no-noninteractive-element-interactions": [
834
+ "error",
835
+ {
836
+ handlers: [
837
+ "onClick",
838
+ "onError",
839
+ "onLoad",
840
+ "onMouseDown",
841
+ "onMouseUp",
842
+ "onKeyPress",
843
+ "onKeyDown",
844
+ "onKeyUp"
845
+ ],
846
+ alert: ["onKeyUp", "onKeyDown", "onKeyPress"],
847
+ body: ["onError", "onLoad"],
848
+ dialog: ["onKeyUp", "onKeyDown", "onKeyPress"],
849
+ iframe: ["onError", "onLoad"],
850
+ img: ["onError", "onLoad"]
851
+ }
852
+ ],
853
+ "jsx-a11y/no-noninteractive-element-to-interactive-role": [
854
+ "error",
855
+ {
856
+ ul: ["listbox", "menu", "menubar", "radiogroup", "tablist", "tree", "treegrid"],
857
+ ol: ["listbox", "menu", "menubar", "radiogroup", "tablist", "tree", "treegrid"],
858
+ li: ["menuitem", "menuitemradio", "menuitemcheckbox", "option", "row", "tab", "treeitem"],
859
+ table: ["grid"],
860
+ td: ["gridcell"],
861
+ fieldset: ["radiogroup", "presentation"]
862
+ }
863
+ ],
864
+ "jsx-a11y/no-noninteractive-tabindex": [
865
+ "error",
866
+ { tags: [], roles: ["tabpanel"], allowExpressionValues: true }
867
+ ],
868
+ "jsx-a11y/no-redundant-roles": "error",
869
+ "jsx-a11y/no-static-element-interactions": [
870
+ "error",
871
+ {
872
+ allowExpressionValues: true,
873
+ handlers: ["onClick", "onMouseDown", "onMouseUp", "onKeyPress", "onKeyDown", "onKeyUp"]
874
+ }
875
+ ],
876
+ "jsx-a11y/role-has-required-aria-props": "error",
877
+ "jsx-a11y/role-supports-aria-props": "error",
878
+ "jsx-a11y/scope": "error",
879
+ "jsx-a11y/tabindex-no-positive": "error"
880
+ // End expansion
881
+ };
882
+
883
+ // src/presets/node.ts
884
+ var nodeRecommendedRules = {
885
+ // Begin expansion 'eslint-plugin-n' 'flat/recommended'
886
+ "node/no-deprecated-api": "error",
887
+ "node/no-extraneous-import": "error",
888
+ "node/no-extraneous-require": "error",
889
+ "node/no-exports-assign": "error",
890
+ "node/no-missing-import": "error",
891
+ "node/no-missing-require": "error",
892
+ "node/no-process-exit": "error",
893
+ "node/no-unpublished-bin": "error",
894
+ "node/no-unpublished-import": "error",
895
+ "node/no-unpublished-require": "error",
896
+ "node/no-unsupported-features/es-builtins": "error",
897
+ "node/no-unsupported-features/es-syntax": ["error", { ignores: ["modules"] }],
898
+ "node/no-unsupported-features/node-builtins": "error",
899
+ "node/process-exit-as-throw": "error",
900
+ "node/hashbang": "error"
901
+ // End expansion
902
+ };
903
+
904
+ // src/presets/perfectionist.ts
905
+ var perfectionistRecommendedNaturalRules = {
906
+ // Begin expansion 'eslint-plugin-perfectionist' 'recommended-natural'
907
+ "perfectionist/sort-variable-declarations": ["error", { type: "natural", order: "asc" }],
908
+ "perfectionist/sort-intersection-types": ["error", { type: "natural", order: "asc" }],
909
+ "perfectionist/sort-heritage-clauses": ["error", { type: "natural", order: "asc" }],
910
+ "perfectionist/sort-array-includes": ["error", { type: "natural", order: "asc" }],
911
+ "perfectionist/sort-named-imports": ["error", { type: "natural", order: "asc" }],
912
+ "perfectionist/sort-named-exports": ["error", { type: "natural", order: "asc" }],
913
+ "perfectionist/sort-object-types": ["error", { type: "natural", order: "asc" }],
914
+ "perfectionist/sort-union-types": ["error", { type: "natural", order: "asc" }],
915
+ "perfectionist/sort-switch-case": ["error", { type: "natural", order: "asc" }],
916
+ "perfectionist/sort-decorators": ["error", { type: "natural", order: "asc" }],
917
+ "perfectionist/sort-interfaces": ["error", { type: "natural", order: "asc" }],
918
+ "perfectionist/sort-jsx-props": ["error", { type: "natural", order: "asc" }],
919
+ "perfectionist/sort-modules": ["error", { type: "natural", order: "asc" }],
920
+ "perfectionist/sort-classes": ["error", { type: "natural", order: "asc" }],
921
+ "perfectionist/sort-imports": ["error", { type: "natural", order: "asc" }],
922
+ "perfectionist/sort-exports": ["error", { type: "natural", order: "asc" }],
923
+ "perfectionist/sort-objects": ["error", { type: "natural", order: "asc" }],
924
+ "perfectionist/sort-enums": ["error", { type: "natural", order: "asc" }],
925
+ "perfectionist/sort-sets": ["error", { type: "natural", order: "asc" }],
926
+ "perfectionist/sort-maps": ["error", { type: "natural", order: "asc" }]
927
+ // End expansion
928
+ };
929
+
930
+ // src/presets/prettier.ts
931
+ var prettierRules = {
932
+ // Begin expansion 'eslint-config-prettier' 'rules'
933
+ curly: 0,
934
+ "no-unexpected-multiline": 0,
935
+ // "@stylistic/lines-around-comment":0,
936
+ // "@stylistic/max-len":0,
937
+ // "@stylistic/no-confusing-arrow":0,
938
+ // "@stylistic/no-mixed-operators":0,
939
+ // "@stylistic/no-tabs":0,
940
+ // "@stylistic/quotes":0,
941
+ // "@stylistic/js/lines-around-comment":0,
942
+ // "@stylistic/js/max-len":0,
943
+ // "@stylistic/js/no-confusing-arrow":0,
944
+ // "@stylistic/js/no-mixed-operators":0,
945
+ // "@stylistic/js/no-tabs":0,
946
+ // "@stylistic/js/quotes":0,
947
+ // "@stylistic/ts/lines-around-comment":0,
948
+ // "@stylistic/ts/quotes":0,
949
+ "ts/lines-around-comment": 0,
950
+ "ts/quotes": 0,
951
+ "babel/quotes": 0,
952
+ "unicorn/template-indent": 0,
953
+ "vue/html-self-closing": 0,
954
+ "vue/max-len": 0,
955
+ "@babel/object-curly-spacing": "off",
956
+ "@babel/semi": "off",
957
+ // "@stylistic/array-bracket-newline":"off",
958
+ // "@stylistic/array-bracket-spacing":"off",
959
+ // "@stylistic/array-element-newline":"off",
960
+ // "@stylistic/arrow-parens":"off",
961
+ // "@stylistic/arrow-spacing":"off",
962
+ // "@stylistic/block-spacing":"off",
963
+ // "@stylistic/brace-style":"off",
964
+ // "@stylistic/comma-dangle":"off",
965
+ // "@stylistic/comma-spacing":"off",
966
+ // "@stylistic/comma-style":"off",
967
+ // "@stylistic/computed-property-spacing":"off",
968
+ // "@stylistic/dot-location":"off",
969
+ // "@stylistic/eol-last":"off",
970
+ // "@stylistic/func-call-spacing":"off",
971
+ // "@stylistic/function-call-argument-newline":"off",
972
+ // "@stylistic/function-call-spacing":"off",
973
+ // "@stylistic/function-paren-newline":"off",
974
+ // "@stylistic/generator-star-spacing":"off",
975
+ // "@stylistic/implicit-arrow-linebreak":"off",
976
+ // "@stylistic/indent":"off",
977
+ // "@stylistic/jsx-quotes":"off",
978
+ // "@stylistic/key-spacing":"off",
979
+ // "@stylistic/keyword-spacing":"off",
980
+ // "@stylistic/linebreak-style":"off",
981
+ // "@stylistic/max-statements-per-line":"off",
982
+ // "@stylistic/multiline-ternary":"off",
983
+ // "@stylistic/new-parens":"off",
984
+ // "@stylistic/newline-per-chained-call":"off",
985
+ // "@stylistic/no-extra-parens":"off",
986
+ // "@stylistic/no-extra-semi":"off",
987
+ // "@stylistic/no-floating-decimal":"off",
988
+ // "@stylistic/no-mixed-spaces-and-tabs":"off",
989
+ // "@stylistic/no-multi-spaces":"off",
990
+ // "@stylistic/no-multiple-empty-lines":"off",
991
+ // "@stylistic/no-trailing-spaces":"off",
992
+ // "@stylistic/no-whitespace-before-property":"off",
993
+ // "@stylistic/nonblock-statement-body-position":"off",
994
+ // "@stylistic/object-curly-newline":"off",
995
+ // "@stylistic/object-curly-spacing":"off",
996
+ // "@stylistic/object-property-newline":"off",
997
+ // "@stylistic/one-var-declaration-per-line":"off",
998
+ // "@stylistic/operator-linebreak":"off",
999
+ // "@stylistic/padded-blocks":"off",
1000
+ // "@stylistic/quote-props":"off",
1001
+ // "@stylistic/rest-spread-spacing":"off",
1002
+ // "@stylistic/semi":"off",
1003
+ // "@stylistic/semi-spacing":"off",
1004
+ // "@stylistic/semi-style":"off",
1005
+ // "@stylistic/space-before-blocks":"off",
1006
+ // "@stylistic/space-before-function-paren":"off",
1007
+ // "@stylistic/space-in-parens":"off",
1008
+ // "@stylistic/space-infix-ops":"off",
1009
+ // "@stylistic/space-unary-ops":"off",
1010
+ // "@stylistic/switch-colon-spacing":"off",
1011
+ // "@stylistic/template-curly-spacing":"off",
1012
+ // "@stylistic/template-tag-spacing":"off",
1013
+ // "@stylistic/wrap-iife":"off",
1014
+ // "@stylistic/wrap-regex":"off",
1015
+ // "@stylistic/yield-star-spacing":"off",
1016
+ // "@stylistic/member-delimiter-style":"off",
1017
+ // "@stylistic/type-annotation-spacing":"off",
1018
+ // "@stylistic/jsx-child-element-spacing":"off",
1019
+ // "@stylistic/jsx-closing-bracket-location":"off",
1020
+ // "@stylistic/jsx-closing-tag-location":"off",
1021
+ // "@stylistic/jsx-curly-newline":"off",
1022
+ // "@stylistic/jsx-curly-spacing":"off",
1023
+ // "@stylistic/jsx-equals-spacing":"off",
1024
+ // "@stylistic/jsx-first-prop-new-line":"off",
1025
+ // "@stylistic/jsx-indent":"off",
1026
+ // "@stylistic/jsx-indent-props":"off",
1027
+ // "@stylistic/jsx-max-props-per-line":"off",
1028
+ // "@stylistic/jsx-newline":"off",
1029
+ // "@stylistic/jsx-one-expression-per-line":"off",
1030
+ // "@stylistic/jsx-props-no-multi-spaces":"off",
1031
+ // "@stylistic/jsx-tag-spacing":"off",
1032
+ // "@stylistic/jsx-wrap-multilines":"off",
1033
+ // "@stylistic/indent-binary-ops":"off",
1034
+ // "@stylistic/type-generic-spacing":"off",
1035
+ // "@stylistic/type-named-tuple-spacing":"off",
1036
+ // "@stylistic/js/array-bracket-newline":"off",
1037
+ // "@stylistic/js/array-bracket-spacing":"off",
1038
+ // "@stylistic/js/array-element-newline":"off",
1039
+ // "@stylistic/js/arrow-parens":"off",
1040
+ // "@stylistic/js/arrow-spacing":"off",
1041
+ // "@stylistic/js/block-spacing":"off",
1042
+ // "@stylistic/js/brace-style":"off",
1043
+ // "@stylistic/js/comma-dangle":"off",
1044
+ // "@stylistic/js/comma-spacing":"off",
1045
+ // "@stylistic/js/comma-style":"off",
1046
+ // "@stylistic/js/computed-property-spacing":"off",
1047
+ // "@stylistic/js/dot-location":"off",
1048
+ // "@stylistic/js/eol-last":"off",
1049
+ // "@stylistic/js/func-call-spacing":"off",
1050
+ // "@stylistic/js/function-call-argument-newline":"off",
1051
+ // "@stylistic/js/function-call-spacing":"off",
1052
+ // "@stylistic/js/function-paren-newline":"off",
1053
+ // "@stylistic/js/generator-star-spacing":"off",
1054
+ // "@stylistic/js/implicit-arrow-linebreak":"off",
1055
+ // "@stylistic/js/indent":"off",
1056
+ // "@stylistic/js/jsx-quotes":"off",
1057
+ // "@stylistic/js/key-spacing":"off",
1058
+ // "@stylistic/js/keyword-spacing":"off",
1059
+ // "@stylistic/js/linebreak-style":"off",
1060
+ // "@stylistic/js/max-statements-per-line":"off",
1061
+ // "@stylistic/js/multiline-ternary":"off",
1062
+ // "@stylistic/js/new-parens":"off",
1063
+ // "@stylistic/js/newline-per-chained-call":"off",
1064
+ // "@stylistic/js/no-extra-parens":"off",
1065
+ // "@stylistic/js/no-extra-semi":"off",
1066
+ // "@stylistic/js/no-floating-decimal":"off",
1067
+ // "@stylistic/js/no-mixed-spaces-and-tabs":"off",
1068
+ // "@stylistic/js/no-multi-spaces":"off",
1069
+ // "@stylistic/js/no-multiple-empty-lines":"off",
1070
+ // "@stylistic/js/no-trailing-spaces":"off",
1071
+ // "@stylistic/js/no-whitespace-before-property":"off",
1072
+ // "@stylistic/js/nonblock-statement-body-position":"off",
1073
+ // "@stylistic/js/object-curly-newline":"off",
1074
+ // "@stylistic/js/object-curly-spacing":"off",
1075
+ // "@stylistic/js/object-property-newline":"off",
1076
+ // "@stylistic/js/one-var-declaration-per-line":"off",
1077
+ // "@stylistic/js/operator-linebreak":"off",
1078
+ // "@stylistic/js/padded-blocks":"off",
1079
+ // "@stylistic/js/quote-props":"off",
1080
+ // "@stylistic/js/rest-spread-spacing":"off",
1081
+ // "@stylistic/js/semi":"off",
1082
+ // "@stylistic/js/semi-spacing":"off",
1083
+ // "@stylistic/js/semi-style":"off",
1084
+ // "@stylistic/js/space-before-blocks":"off",
1085
+ // "@stylistic/js/space-before-function-paren":"off",
1086
+ // "@stylistic/js/space-in-parens":"off",
1087
+ // "@stylistic/js/space-infix-ops":"off",
1088
+ // "@stylistic/js/space-unary-ops":"off",
1089
+ // "@stylistic/js/switch-colon-spacing":"off",
1090
+ // "@stylistic/js/template-curly-spacing":"off",
1091
+ // "@stylistic/js/template-tag-spacing":"off",
1092
+ // "@stylistic/js/wrap-iife":"off",
1093
+ // "@stylistic/js/wrap-regex":"off",
1094
+ // "@stylistic/js/yield-star-spacing":"off",
1095
+ // "@stylistic/ts/block-spacing":"off",
1096
+ // "@stylistic/ts/brace-style":"off",
1097
+ // "@stylistic/ts/comma-dangle":"off",
1098
+ // "@stylistic/ts/comma-spacing":"off",
1099
+ // "@stylistic/ts/func-call-spacing":"off",
1100
+ // "@stylistic/ts/function-call-spacing":"off",
1101
+ // "@stylistic/ts/indent":"off",
1102
+ // "@stylistic/ts/key-spacing":"off",
1103
+ // "@stylistic/ts/keyword-spacing":"off",
1104
+ // "@stylistic/ts/member-delimiter-style":"off",
1105
+ // "@stylistic/ts/no-extra-parens":"off",
1106
+ // "@stylistic/ts/no-extra-semi":"off",
1107
+ // "@stylistic/ts/object-curly-spacing":"off",
1108
+ // "@stylistic/ts/semi":"off",
1109
+ // "@stylistic/ts/space-before-blocks":"off",
1110
+ // "@stylistic/ts/space-before-function-paren":"off",
1111
+ // "@stylistic/ts/space-infix-ops":"off",
1112
+ // "@stylistic/ts/type-annotation-spacing":"off",
1113
+ // "@stylistic/jsx/jsx-child-element-spacing":"off",
1114
+ // "@stylistic/jsx/jsx-closing-bracket-location":"off",
1115
+ // "@stylistic/jsx/jsx-closing-tag-location":"off",
1116
+ // "@stylistic/jsx/jsx-curly-newline":"off",
1117
+ // "@stylistic/jsx/jsx-curly-spacing":"off",
1118
+ // "@stylistic/jsx/jsx-equals-spacing":"off",
1119
+ // "@stylistic/jsx/jsx-first-prop-new-line":"off",
1120
+ // "@stylistic/jsx/jsx-indent":"off",
1121
+ // "@stylistic/jsx/jsx-indent-props":"off",
1122
+ // "@stylistic/jsx/jsx-max-props-per-line":"off",
1123
+ "ts/block-spacing": "off",
1124
+ "ts/brace-style": "off",
1125
+ "ts/comma-dangle": "off",
1126
+ "ts/comma-spacing": "off",
1127
+ "ts/func-call-spacing": "off",
1128
+ "ts/indent": "off",
1129
+ "ts/key-spacing": "off",
1130
+ "ts/keyword-spacing": "off",
1131
+ "ts/member-delimiter-style": "off",
1132
+ "ts/no-extra-parens": "off",
1133
+ "ts/no-extra-semi": "off",
1134
+ "ts/object-curly-spacing": "off",
1135
+ "ts/semi": "off",
1136
+ "ts/space-before-blocks": "off",
1137
+ "ts/space-before-function-paren": "off",
1138
+ "ts/space-infix-ops": "off",
1139
+ "ts/type-annotation-spacing": "off",
1140
+ "babel/object-curly-spacing": "off",
1141
+ "babel/semi": "off",
1142
+ "flowtype/boolean-style": "off",
1143
+ "flowtype/delimiter-dangle": "off",
1144
+ "flowtype/generic-spacing": "off",
1145
+ "flowtype/object-type-curly-spacing": "off",
1146
+ "flowtype/object-type-delimiter": "off",
1147
+ "flowtype/quotes": "off",
1148
+ "flowtype/semi": "off",
1149
+ "flowtype/space-after-type-colon": "off",
1150
+ "flowtype/space-before-generic-bracket": "off",
1151
+ "flowtype/space-before-type-colon": "off",
1152
+ "flowtype/union-intersection-spacing": "off",
1153
+ "react/jsx-child-element-spacing": "off",
1154
+ "react/jsx-closing-bracket-location": "off",
1155
+ "react/jsx-closing-tag-location": "off",
1156
+ "react/jsx-curly-newline": "off",
1157
+ "react/jsx-curly-spacing": "off",
1158
+ "react/jsx-equals-spacing": "off",
1159
+ "react/jsx-first-prop-new-line": "off",
1160
+ "react/jsx-indent": "off",
1161
+ "react/jsx-indent-props": "off",
1162
+ "react/jsx-max-props-per-line": "off",
1163
+ "react/jsx-newline": "off",
1164
+ "react/jsx-one-expression-per-line": "off",
1165
+ "react/jsx-props-no-multi-spaces": "off",
1166
+ "react/jsx-tag-spacing": "off",
1167
+ "react/jsx-wrap-multilines": "off",
1168
+ "standard/array-bracket-even-spacing": "off",
1169
+ "standard/computed-property-even-spacing": "off",
1170
+ "standard/object-curly-even-spacing": "off",
1171
+ "unicorn/empty-brace-spaces": "off",
1172
+ "unicorn/no-nested-ternary": "off",
1173
+ "unicorn/number-literal-case": "off",
1174
+ "vue/array-bracket-newline": "off",
1175
+ "vue/array-bracket-spacing": "off",
1176
+ "vue/array-element-newline": "off",
1177
+ "vue/arrow-spacing": "off",
1178
+ "vue/block-spacing": "off",
1179
+ "vue/block-tag-newline": "off",
1180
+ "vue/brace-style": "off",
1181
+ "vue/comma-dangle": "off",
1182
+ "vue/comma-spacing": "off",
1183
+ "vue/comma-style": "off",
1184
+ "vue/dot-location": "off",
1185
+ "vue/func-call-spacing": "off",
1186
+ "vue/html-closing-bracket-newline": "off",
1187
+ "vue/html-closing-bracket-spacing": "off",
1188
+ "vue/html-end-tags": "off",
1189
+ "vue/html-indent": "off",
1190
+ "vue/html-quotes": "off",
1191
+ "vue/key-spacing": "off",
1192
+ "vue/keyword-spacing": "off",
1193
+ "vue/max-attributes-per-line": "off",
1194
+ "vue/multiline-html-element-content-newline": "off",
1195
+ "vue/multiline-ternary": "off",
1196
+ "vue/mustache-interpolation-spacing": "off",
1197
+ "vue/no-extra-parens": "off",
1198
+ "vue/no-multi-spaces": "off",
1199
+ "vue/no-spaces-around-equal-signs-in-attribute": "off",
1200
+ "vue/object-curly-newline": "off",
1201
+ "vue/object-curly-spacing": "off",
1202
+ "vue/object-property-newline": "off",
1203
+ "vue/operator-linebreak": "off",
1204
+ "vue/quote-props": "off",
1205
+ "vue/script-indent": "off",
1206
+ "vue/singleline-html-element-content-newline": "off",
1207
+ "vue/space-in-parens": "off",
1208
+ "vue/space-infix-ops": "off",
1209
+ "vue/space-unary-ops": "off",
1210
+ "vue/template-curly-spacing": "off",
1211
+ "space-unary-word-ops": "off",
1212
+ "generator-star": "off",
1213
+ "no-comma-dangle": "off",
1214
+ "no-reserved-keys": "off",
1215
+ "no-space-before-semi": "off",
1216
+ "no-wrap-func": "off",
1217
+ "space-after-function-name": "off",
1218
+ "space-before-function-parentheses": "off",
1219
+ "space-in-brackets": "off",
1220
+ "no-arrow-condition": "off",
1221
+ "space-after-keywords": "off",
1222
+ "space-before-keywords": "off",
1223
+ "space-return-throw-case": "off",
1224
+ "no-spaced-func": "off",
1225
+ "indent-legacy": "off",
1226
+ "array-bracket-newline": "off",
1227
+ "array-bracket-spacing": "off",
1228
+ "array-element-newline": "off",
1229
+ "arrow-parens": "off",
1230
+ "arrow-spacing": "off",
1231
+ "block-spacing": "off",
1232
+ "brace-style": "off",
1233
+ "comma-dangle": "off",
1234
+ "comma-spacing": "off",
1235
+ "comma-style": "off",
1236
+ "computed-property-spacing": "off",
1237
+ "dot-location": "off",
1238
+ "eol-last": "off",
1239
+ "func-call-spacing": "off",
1240
+ "function-call-argument-newline": "off",
1241
+ "function-paren-newline": "off",
1242
+ "generator-star-spacing": "off",
1243
+ "implicit-arrow-linebreak": "off",
1244
+ indent: "off",
1245
+ "jsx-quotes": "off",
1246
+ "key-spacing": "off",
1247
+ "keyword-spacing": "off",
1248
+ "linebreak-style": "off",
1249
+ "lines-around-comment": 0,
1250
+ "max-len": 0,
1251
+ "max-statements-per-line": "off",
1252
+ "multiline-ternary": "off",
1253
+ "new-parens": "off",
1254
+ "newline-per-chained-call": "off",
1255
+ "no-confusing-arrow": 0,
1256
+ "no-extra-parens": "off",
1257
+ "no-extra-semi": "off",
1258
+ "no-floating-decimal": "off",
1259
+ "no-mixed-operators": 0,
1260
+ "no-mixed-spaces-and-tabs": "off",
1261
+ "no-multi-spaces": "off",
1262
+ "no-multiple-empty-lines": "off",
1263
+ "no-tabs": 0,
1264
+ "no-trailing-spaces": "off",
1265
+ "no-whitespace-before-property": "off",
1266
+ "nonblock-statement-body-position": "off",
1267
+ "object-curly-newline": "off",
1268
+ "object-curly-spacing": "off",
1269
+ "object-property-newline": "off",
1270
+ "one-var-declaration-per-line": "off",
1271
+ "operator-linebreak": "off",
1272
+ "padded-blocks": "off",
1273
+ "quote-props": "off",
1274
+ quotes: 0,
1275
+ "rest-spread-spacing": "off",
1276
+ semi: "off",
1277
+ "semi-spacing": "off",
1278
+ "semi-style": "off",
1279
+ "space-before-blocks": "off",
1280
+ "space-before-function-paren": "off",
1281
+ "space-in-parens": "off",
1282
+ "space-infix-ops": "off",
1283
+ "space-unary-ops": "off",
1284
+ "switch-colon-spacing": "off",
1285
+ "template-curly-spacing": "off",
1286
+ "template-tag-spacing": "off",
1287
+ "wrap-iife": "off",
1288
+ "wrap-regex": "off",
1289
+ "yield-star-spacing": "off",
1290
+ "react/jsx-space-before-closing": "off"
1291
+ // End expansion
1292
+ };
1293
+
1294
+ // src/presets/react.ts
1295
+ var reactRecommendedTypeCheckedRules = {
1296
+ // Begin expansion '@eslint-react/eslint-plugin' 'recommended-type-checked'
1297
+ "react/ensure-forward-ref-using-ref": "warn",
1298
+ "react/no-access-state-in-setstate": "error",
1299
+ "react/no-array-index-key": "warn",
1300
+ "react/no-children-count": "warn",
1301
+ "react/no-children-for-each": "warn",
1302
+ "react/no-children-map": "warn",
1303
+ "react/no-children-only": "warn",
1304
+ "react/no-children-to-array": "warn",
1305
+ "react/no-clone-element": "warn",
1306
+ "react/no-comment-textnodes": "warn",
1307
+ "react/no-component-will-mount": "error",
1308
+ "react/no-component-will-receive-props": "error",
1309
+ "react/no-component-will-update": "error",
1310
+ "react/no-context-provider": "warn",
1311
+ "react/no-create-ref": "error",
1312
+ "react/no-default-props": "error",
1313
+ "react/no-direct-mutation-state": "error",
1314
+ "react/no-duplicate-jsx-props": "off",
1315
+ "react/no-duplicate-key": "error",
1316
+ "react/no-forward-ref": "warn",
1317
+ "react/no-implicit-key": "warn",
1318
+ "react/no-missing-key": "error",
1319
+ "react/no-nested-components": "error",
1320
+ "react/no-prop-types": "error",
1321
+ "react/no-redundant-should-component-update": "error",
1322
+ "react/no-set-state-in-component-did-mount": "warn",
1323
+ "react/no-set-state-in-component-did-update": "warn",
1324
+ "react/no-set-state-in-component-will-update": "warn",
1325
+ "react/no-string-refs": "error",
1326
+ "react/no-unsafe-component-will-mount": "warn",
1327
+ "react/no-unsafe-component-will-receive-props": "warn",
1328
+ "react/no-unsafe-component-will-update": "warn",
1329
+ "react/no-unstable-context-value": "warn",
1330
+ "react/no-unstable-default-props": "warn",
1331
+ "react/no-unused-class-component-members": "warn",
1332
+ "react/no-unused-state": "warn",
1333
+ "react/no-use-context": "warn",
1334
+ "react/use-jsx-vars": "off",
1335
+ "react-dom/no-dangerously-set-innerhtml": "warn",
1336
+ "react-dom/no-dangerously-set-innerhtml-with-children": "error",
1337
+ "react-dom/no-find-dom-node": "error",
1338
+ "react-dom/no-missing-button-type": "warn",
1339
+ "react-dom/no-missing-iframe-sandbox": "warn",
1340
+ "react-dom/no-namespace": "error",
1341
+ "react-dom/no-render-return-value": "error",
1342
+ "react-dom/no-script-url": "warn",
1343
+ "react-dom/no-unsafe-iframe-sandbox": "warn",
1344
+ "react-dom/no-unsafe-target-blank": "warn",
1345
+ "react-dom/no-void-elements-with-children": "warn",
1346
+ "react-web-api/no-leaked-event-listener": "warn",
1347
+ "react-web-api/no-leaked-interval": "warn",
1348
+ "react-web-api/no-leaked-resize-observer": "warn",
1349
+ "react-web-api/no-leaked-timeout": "warn",
1350
+ "react-hooks-extra/no-direct-set-state-in-use-effect": "warn",
1351
+ "react-hooks-extra/no-useless-custom-hooks": "warn",
1352
+ "react-hooks-extra/prefer-use-state-lazy-initialization": "warn",
1353
+ "react-dom/no-unknown-property": "off",
1354
+ "react/no-leaked-conditional-rendering": "warn"
1355
+ // End expansion
1356
+ };
1357
+ var reactDisableTypeCheckedRules = {
1358
+ // Begin expansion '@eslint-react/eslint-plugin' 'disable-type-checked'
1359
+ "react/no-leaked-conditional-rendering": "off",
1360
+ "react/prefer-read-only-props": "off"
1361
+ // End expansion
1362
+ };
1363
+
1364
+ // src/presets/regexp.ts
1365
+ var regexpRecommendedRules = {
1366
+ // Begin expansion 'eslint-plugin-regexp' 'flat/recommended'
1367
+ "no-control-regex": "error",
1368
+ "no-misleading-character-class": "error",
1369
+ "no-regex-spaces": "error",
1370
+ "prefer-regex-literals": "error",
1371
+ "no-invalid-regexp": "off",
1372
+ "no-useless-backreference": "off",
1373
+ "no-empty-character-class": "off",
1374
+ "regexp/confusing-quantifier": "warn",
1375
+ "regexp/control-character-escape": "error",
1376
+ "regexp/match-any": "error",
1377
+ "regexp/negation": "error",
1378
+ "regexp/no-contradiction-with-assertion": "error",
1379
+ "regexp/no-dupe-characters-character-class": "error",
1380
+ "regexp/no-dupe-disjunctions": "error",
1381
+ "regexp/no-empty-alternative": "warn",
1382
+ "regexp/no-empty-capturing-group": "error",
1383
+ "regexp/no-empty-character-class": "error",
1384
+ "regexp/no-empty-group": "error",
1385
+ "regexp/no-empty-lookarounds-assertion": "error",
1386
+ "regexp/no-empty-string-literal": "error",
1387
+ "regexp/no-escape-backspace": "error",
1388
+ "regexp/no-extra-lookaround-assertions": "error",
1389
+ "regexp/no-invalid-regexp": "error",
1390
+ "regexp/no-invisible-character": "error",
1391
+ "regexp/no-lazy-ends": "warn",
1392
+ "regexp/no-legacy-features": "error",
1393
+ "regexp/no-misleading-capturing-group": "error",
1394
+ "regexp/no-misleading-unicode-character": "error",
1395
+ "regexp/no-missing-g-flag": "error",
1396
+ "regexp/no-non-standard-flag": "error",
1397
+ "regexp/no-obscure-range": "error",
1398
+ "regexp/no-optional-assertion": "error",
1399
+ "regexp/no-potentially-useless-backreference": "warn",
1400
+ "regexp/no-super-linear-backtracking": "error",
1401
+ "regexp/no-trivially-nested-assertion": "error",
1402
+ "regexp/no-trivially-nested-quantifier": "error",
1403
+ "regexp/no-unused-capturing-group": "error",
1404
+ "regexp/no-useless-assertions": "error",
1405
+ "regexp/no-useless-backreference": "error",
1406
+ "regexp/no-useless-character-class": "error",
1407
+ "regexp/no-useless-dollar-replacements": "error",
1408
+ "regexp/no-useless-escape": "error",
1409
+ "regexp/no-useless-flag": "warn",
1410
+ "regexp/no-useless-lazy": "error",
1411
+ "regexp/no-useless-non-capturing-group": "error",
1412
+ "regexp/no-useless-quantifier": "error",
1413
+ "regexp/no-useless-range": "error",
1414
+ "regexp/no-useless-set-operand": "error",
1415
+ "regexp/no-useless-string-literal": "error",
1416
+ "regexp/no-useless-two-nums-quantifier": "error",
1417
+ "regexp/no-zero-quantifier": "error",
1418
+ "regexp/optimal-lookaround-quantifier": "warn",
1419
+ "regexp/optimal-quantifier-concatenation": "error",
1420
+ "regexp/prefer-character-class": "error",
1421
+ "regexp/prefer-d": "error",
1422
+ "regexp/prefer-plus-quantifier": "error",
1423
+ "regexp/prefer-predefined-assertion": "error",
1424
+ "regexp/prefer-question-quantifier": "error",
1425
+ "regexp/prefer-range": "error",
1426
+ "regexp/prefer-set-operation": "error",
1427
+ "regexp/prefer-star-quantifier": "error",
1428
+ "regexp/prefer-unicode-codepoint-escapes": "error",
1429
+ "regexp/prefer-w": "error",
1430
+ "regexp/simplify-set-operations": "error",
1431
+ "regexp/sort-flags": "error",
1432
+ "regexp/strict": "error",
1433
+ "regexp/use-ignore-case": "error"
1434
+ // End expansion
1435
+ };
1436
+
1437
+ // src/presets/svelte.ts
1438
+ var svelteRecommendedRules = {
1439
+ // Begin expansion 'eslint-plugin-svelte' 'recommended'
1440
+ "svelte/comment-directive": "error",
1441
+ "svelte/no-at-debug-tags": "warn",
1442
+ "svelte/no-at-html-tags": "error",
1443
+ "svelte/no-dupe-else-if-blocks": "error",
1444
+ "svelte/no-dupe-style-properties": "error",
1445
+ "svelte/no-dynamic-slot-name": "error",
1446
+ "svelte/no-inner-declarations": "error",
1447
+ "svelte/no-not-function-handler": "error",
1448
+ "svelte/no-object-in-text-mustaches": "error",
1449
+ "svelte/no-shorthand-style-property-overrides": "error",
1450
+ "svelte/no-unknown-style-directive-property": "error",
1451
+ "svelte/no-unused-svelte-ignore": "error",
1452
+ "svelte/system": "error",
1453
+ "svelte/valid-compile": "error"
1454
+ // End expansion
1455
+ };
1456
+
1457
+ // src/presets/test.ts
1458
+ var testRecommendedRules = {
1459
+ // Begin expansion '@vitest/eslint-plugin' 'recommended'
1460
+ "test/expect-expect": "error",
1461
+ "test/no-identical-title": "error",
1462
+ "test/no-commented-out-tests": "error",
1463
+ "test/valid-title": "error",
1464
+ "test/valid-expect": "error",
1465
+ "test/valid-describe-callback": "error",
1466
+ "test/require-local-test-context-for-concurrent-snapshots": "error",
1467
+ "test/no-import-node-test": "error"
1468
+ // End expansion
1469
+ };
1470
+
1471
+ // src/presets/toml.ts
1472
+ var tomlRecommendedRules = {
1473
+ // Begin expansion 'eslint-plugin-toml' 'flat/recommended[2]'
1474
+ "toml/no-unreadable-number-separator": "error",
1475
+ "toml/precision-of-fractional-seconds": "error",
1476
+ "toml/precision-of-integer": "error",
1477
+ "toml/vue-custom-block/no-parsing-error": "error"
1478
+ // End expansion
1479
+ };
1480
+
1481
+ // src/presets/unicorn.ts
1482
+ var unicornRecommendedRules = {
1483
+ // Begin expansion 'eslint-plugin-unicorn' 'recommended'
1484
+ "no-negated-condition": "off",
1485
+ "no-nested-ternary": "off",
1486
+ "unicorn/better-regex": "off",
1487
+ "unicorn/catch-error-name": "error",
1488
+ "unicorn/consistent-destructuring": "off",
1489
+ "unicorn/consistent-empty-array-spread": "error",
1490
+ "unicorn/consistent-existence-index-check": "error",
1491
+ "unicorn/consistent-function-scoping": "error",
1492
+ "unicorn/custom-error-definition": "off",
1493
+ "unicorn/empty-brace-spaces": "error",
1494
+ "unicorn/error-message": "error",
1495
+ "unicorn/escape-case": "error",
1496
+ "unicorn/expiring-todo-comments": "error",
1497
+ "unicorn/explicit-length-check": "error",
1498
+ "unicorn/filename-case": "error",
1499
+ "unicorn/import-style": "error",
1500
+ "unicorn/new-for-builtins": "error",
1501
+ "unicorn/no-abusive-eslint-disable": "error",
1502
+ "unicorn/no-anonymous-default-export": "error",
1503
+ "unicorn/no-array-callback-reference": "error",
1504
+ "unicorn/no-array-for-each": "error",
1505
+ "unicorn/no-array-method-this-argument": "error",
1506
+ "unicorn/no-array-push-push": "error",
1507
+ "unicorn/no-array-reduce": "error",
1508
+ "unicorn/no-await-expression-member": "error",
1509
+ "unicorn/no-await-in-promise-methods": "error",
1510
+ "unicorn/no-console-spaces": "error",
1511
+ "unicorn/no-document-cookie": "error",
1512
+ "unicorn/no-empty-file": "error",
1513
+ "unicorn/no-for-loop": "error",
1514
+ "unicorn/no-hex-escape": "error",
1515
+ "unicorn/no-instanceof-array": "error",
1516
+ "unicorn/no-invalid-fetch-options": "error",
1517
+ "unicorn/no-invalid-remove-event-listener": "error",
1518
+ "unicorn/no-keyword-prefix": "off",
1519
+ "unicorn/no-length-as-slice-end": "error",
1520
+ "unicorn/no-lonely-if": "error",
1521
+ "unicorn/no-magic-array-flat-depth": "error",
1522
+ "unicorn/no-negated-condition": "error",
1523
+ "unicorn/no-negation-in-equality-check": "error",
1524
+ "unicorn/no-nested-ternary": "error",
1525
+ "unicorn/no-new-array": "error",
1526
+ "unicorn/no-new-buffer": "error",
1527
+ "unicorn/no-null": "error",
1528
+ "unicorn/no-object-as-default-parameter": "error",
1529
+ "unicorn/no-process-exit": "error",
1530
+ "unicorn/no-single-promise-in-promise-methods": "error",
1531
+ "unicorn/no-static-only-class": "error",
1532
+ "unicorn/no-thenable": "error",
1533
+ "unicorn/no-this-assignment": "error",
1534
+ "unicorn/no-typeof-undefined": "error",
1535
+ "unicorn/no-unnecessary-await": "error",
1536
+ "unicorn/no-unnecessary-polyfills": "error",
1537
+ "unicorn/no-unreadable-array-destructuring": "error",
1538
+ "unicorn/no-unreadable-iife": "error",
1539
+ "unicorn/no-unused-properties": "off",
1540
+ "unicorn/no-useless-fallback-in-spread": "error",
1541
+ "unicorn/no-useless-length-check": "error",
1542
+ "unicorn/no-useless-promise-resolve-reject": "error",
1543
+ "unicorn/no-useless-spread": "error",
1544
+ "unicorn/no-useless-switch-case": "error",
1545
+ "unicorn/no-useless-undefined": "error",
1546
+ "unicorn/no-zero-fractions": "error",
1547
+ "unicorn/number-literal-case": "error",
1548
+ "unicorn/numeric-separators-style": "error",
1549
+ "unicorn/prefer-add-event-listener": "error",
1550
+ "unicorn/prefer-array-find": "error",
1551
+ "unicorn/prefer-array-flat-map": "error",
1552
+ "unicorn/prefer-array-flat": "error",
1553
+ "unicorn/prefer-array-index-of": "error",
1554
+ "unicorn/prefer-array-some": "error",
1555
+ "unicorn/prefer-at": "error",
1556
+ "unicorn/prefer-blob-reading-methods": "error",
1557
+ "unicorn/prefer-code-point": "error",
1558
+ "unicorn/prefer-date-now": "error",
1559
+ "unicorn/prefer-default-parameters": "error",
1560
+ "unicorn/prefer-dom-node-append": "error",
1561
+ "unicorn/prefer-dom-node-dataset": "error",
1562
+ "unicorn/prefer-dom-node-remove": "error",
1563
+ "unicorn/prefer-dom-node-text-content": "error",
1564
+ "unicorn/prefer-event-target": "error",
1565
+ "unicorn/prefer-export-from": "error",
1566
+ "unicorn/prefer-global-this": "error",
1567
+ "unicorn/prefer-includes": "error",
1568
+ "unicorn/prefer-json-parse-buffer": "off",
1569
+ "unicorn/prefer-keyboard-event-key": "error",
1570
+ "unicorn/prefer-logical-operator-over-ternary": "error",
1571
+ "unicorn/prefer-math-min-max": "error",
1572
+ "unicorn/prefer-math-trunc": "error",
1573
+ "unicorn/prefer-modern-dom-apis": "error",
1574
+ "unicorn/prefer-modern-math-apis": "error",
1575
+ "unicorn/prefer-module": "error",
1576
+ "unicorn/prefer-native-coercion-functions": "error",
1577
+ "unicorn/prefer-negative-index": "error",
1578
+ "unicorn/prefer-node-protocol": "error",
1579
+ "unicorn/prefer-number-properties": "error",
1580
+ "unicorn/prefer-object-from-entries": "error",
1581
+ "unicorn/prefer-optional-catch-binding": "error",
1582
+ "unicorn/prefer-prototype-methods": "error",
1583
+ "unicorn/prefer-query-selector": "error",
1584
+ "unicorn/prefer-reflect-apply": "error",
1585
+ "unicorn/prefer-regexp-test": "error",
1586
+ "unicorn/prefer-set-has": "error",
1587
+ "unicorn/prefer-set-size": "error",
1588
+ "unicorn/prefer-spread": "error",
1589
+ "unicorn/prefer-string-raw": "error",
1590
+ "unicorn/prefer-string-replace-all": "error",
1591
+ "unicorn/prefer-string-slice": "error",
1592
+ "unicorn/prefer-string-starts-ends-with": "error",
1593
+ "unicorn/prefer-string-trim-start-end": "error",
1594
+ "unicorn/prefer-structured-clone": "error",
1595
+ "unicorn/prefer-switch": "error",
1596
+ "unicorn/prefer-ternary": "error",
1597
+ "unicorn/prefer-top-level-await": "error",
1598
+ "unicorn/prefer-type-error": "error",
1599
+ "unicorn/prevent-abbreviations": "error",
1600
+ "unicorn/relative-url-style": "error",
1601
+ "unicorn/require-array-join-separator": "error",
1602
+ "unicorn/require-number-to-fixed-digits-argument": "error",
1603
+ "unicorn/require-post-message-target-origin": "off",
1604
+ "unicorn/string-content": "off",
1605
+ "unicorn/switch-case-braces": "error",
1606
+ "unicorn/template-indent": "error",
1607
+ "unicorn/text-encoding-identifier-case": "error",
1608
+ "unicorn/throw-new-error": "error"
1609
+ // End expansion
1610
+ };
1611
+
1612
+ // src/presets/xo.ts
1613
+ var xoJavascriptRules = {
1614
+ // Begin expansion 'eslint-config-xo-typescript' '[0].rules'
1615
+ // "@stylistic/comma-dangle":["error","always-multiline"],
1616
+ "for-direction": "error",
1617
+ "getter-return": "error",
1618
+ "no-async-promise-executor": "error",
1619
+ "no-await-in-loop": "error",
1620
+ "no-compare-neg-zero": "error",
1621
+ "no-cond-assign": "error",
1622
+ "no-constant-condition": "error",
1623
+ "no-control-regex": "error",
1624
+ "no-debugger": "error",
1625
+ "no-dupe-args": "error",
1626
+ "no-dupe-else-if": "error",
1627
+ "no-dupe-keys": "error",
1628
+ "no-duplicate-case": "error",
1629
+ "no-empty-character-class": "error",
1630
+ "no-empty": ["error", { allowEmptyCatch: true }],
1631
+ "no-empty-static-block": "error",
1632
+ "no-ex-assign": "error",
1633
+ "no-extra-boolean-cast": "error",
1634
+ // "@stylistic/no-extra-semi":"error",
1635
+ "no-func-assign": "error",
1636
+ "no-import-assign": "error",
1637
+ "no-inner-declarations": "error",
1638
+ "no-invalid-regexp": "error",
1639
+ "no-irregular-whitespace": "error",
1640
+ "no-loss-of-precision": "error",
1641
+ "no-misleading-character-class": "error",
1642
+ "no-obj-calls": "error",
1643
+ "no-promise-executor-return": "error",
1644
+ "no-prototype-builtins": "error",
1645
+ "no-regex-spaces": "error",
1646
+ "no-setter-return": "error",
1647
+ "no-sparse-arrays": "error",
1648
+ "no-template-curly-in-string": "error",
1649
+ "no-unreachable": "error",
1650
+ "no-unreachable-loop": "error",
1651
+ "no-unsafe-finally": "error",
1652
+ "no-unsafe-negation": ["error", { enforceForOrderingRelations: true }],
1653
+ "no-unsafe-optional-chaining": ["error", { disallowArithmeticOperators: true }],
1654
+ "no-useless-backreference": "error",
1655
+ "use-isnan": "error",
1656
+ "valid-typeof": ["error", { requireStringLiterals: false }],
1657
+ "no-unexpected-multiline": "error",
1658
+ "accessor-pairs": ["error", { enforceForClassMembers: true }],
1659
+ "array-callback-return": ["error", { allowImplicit: true }],
1660
+ "block-scoped-var": "error",
1661
+ complexity: "warn",
1662
+ curly: "error",
1663
+ "default-case": "error",
1664
+ "default-case-last": "error",
1665
+ "dot-notation": "error",
1666
+ // "@stylistic/dot-location":["error","property"],
1667
+ eqeqeq: "error",
1668
+ "grouped-accessor-pairs": ["error", "getBeforeSet"],
1669
+ "guard-for-in": "error",
1670
+ "no-alert": "error",
1671
+ "no-caller": "error",
1672
+ "no-case-declarations": "error",
1673
+ "no-constructor-return": "error",
1674
+ "no-else-return": ["error", { allowElseIf: false }],
1675
+ "no-empty-pattern": "error",
1676
+ "no-eq-null": "error",
1677
+ "no-eval": "error",
1678
+ "no-extend-native": "error",
1679
+ "no-extra-bind": "error",
1680
+ "no-extra-label": "error",
1681
+ "no-fallthrough": "error",
1682
+ // "@stylistic/no-floating-decimal":"error",
1683
+ "no-global-assign": "error",
1684
+ "no-implicit-coercion": "error",
1685
+ "no-implicit-globals": "error",
1686
+ "no-implied-eval": "error",
1687
+ "no-iterator": "error",
1688
+ "no-labels": "error",
1689
+ "no-lone-blocks": "error",
1690
+ // "@stylistic/no-multi-spaces":"error",
1691
+ "no-multi-str": "error",
1692
+ "no-new-func": "error",
1693
+ "no-new-wrappers": "error",
1694
+ "no-nonoctal-decimal-escape": "error",
1695
+ "no-object-constructor": "error",
1696
+ "no-new": "error",
1697
+ "no-octal-escape": "error",
1698
+ "no-octal": "error",
1699
+ "no-proto": "error",
1700
+ "no-redeclare": "error",
1701
+ "no-return-assign": ["error", "always"],
1702
+ "no-return-await": "error",
1703
+ "no-script-url": "error",
1704
+ "no-self-assign": ["error", { props: true }],
1705
+ "no-self-compare": "error",
1706
+ "no-sequences": "error",
1707
+ "no-throw-literal": "error",
1708
+ "no-unmodified-loop-condition": "error",
1709
+ "no-unused-expressions": ["error", { enforceForJSX: true }],
1710
+ "no-unused-labels": "error",
1711
+ "no-useless-call": "error",
1712
+ "no-useless-catch": "error",
1713
+ "no-useless-concat": "error",
1714
+ "no-useless-escape": "error",
1715
+ "no-useless-return": "error",
1716
+ "no-void": "error",
1717
+ "no-warning-comments": "warn",
1718
+ "no-with": "error",
1719
+ "prefer-promise-reject-errors": ["error", { allowEmptyReject: true }],
1720
+ "prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
1721
+ radix: "error",
1722
+ // "@stylistic/wrap-iife":["error","inside",{"functionPrototypeMethods":true}],
1723
+ yoda: "error",
1724
+ "no-delete-var": "error",
1725
+ "no-label-var": "error",
1726
+ "no-restricted-globals": [
1727
+ "error",
1728
+ "event",
1729
+ {
1730
+ name: "atob",
1731
+ message: "This API is deprecated. Use https://github.com/sindresorhus/uint8array-extras instead."
1732
+ },
1733
+ {
1734
+ name: "btoa",
1735
+ message: "This API is deprecated. Use https://github.com/sindresorhus/uint8array-extras instead."
1736
+ }
1737
+ ],
1738
+ "no-shadow-restricted-names": "error",
1739
+ "no-undef-init": "error",
1740
+ "no-undef": ["error", { typeof: true }],
1741
+ "no-unused-vars": [
1742
+ "error",
1743
+ {
1744
+ vars: "all",
1745
+ varsIgnorePattern: "^_",
1746
+ args: "after-used",
1747
+ ignoreRestSiblings: true,
1748
+ argsIgnorePattern: "^_",
1749
+ caughtErrors: "all",
1750
+ caughtErrorsIgnorePattern: "^_$"
1751
+ }
1752
+ ],
1753
+ "no-buffer-constructor": "error",
1754
+ "no-restricted-imports": [
1755
+ "error",
1756
+ "domain",
1757
+ "freelist",
1758
+ "smalloc",
1759
+ "punycode",
1760
+ "sys",
1761
+ "querystring",
1762
+ "colors"
1763
+ ],
1764
+ // "@stylistic/array-bracket-newline":["error","consistent"],
1765
+ // "@stylistic/array-bracket-spacing":["error","never"],
1766
+ // "@stylistic/array-element-newline":["error","consistent"],
1767
+ // "@stylistic/brace-style":["error","1tbs",{"allowSingleLine":false}],
1768
+ camelcase: ["error", { properties: "always" }],
1769
+ "capitalized-comments": [
1770
+ "error",
1771
+ "always",
1772
+ {
1773
+ ignorePattern: String.raw`pragma|ignore|prettier-ignore|webpack\w+:|c8|type-coverage:`,
1774
+ ignoreInlineComments: true,
1775
+ ignoreConsecutiveComments: true
1776
+ }
1777
+ ],
1778
+ // "@stylistic/comma-spacing":["error",{"before":false,"after":true}],
1779
+ // "@stylistic/comma-style":["error","last"],
1780
+ // "@stylistic/computed-property-spacing":["error","never",{"enforceForClassMembers":true}],
1781
+ // "@stylistic/eol-last":"error",
1782
+ // "@stylistic/function-call-spacing":["error","never"],
1783
+ // "@stylistic/function-paren-newline":["error","multiline"],
1784
+ "func-name-matching": ["error", { considerPropertyDescriptor: true }],
1785
+ "func-names": ["error", "never"],
1786
+ // "@stylistic/function-call-argument-newline":["error","consistent"],
1787
+ // "@stylistic/indent":["error","tab",{"SwitchCase":1}],
1788
+ // "@stylistic/jsx-quotes":["error","prefer-single"],
1789
+ // "@stylistic/key-spacing":["error",{"beforeColon":false,"afterColon":true}],
1790
+ // "@stylistic/keyword-spacing":"error",
1791
+ // "@stylistic/linebreak-style":["error","unix"],
1792
+ // "@stylistic/lines-between-class-members":["error",{"enforce":[{"blankLine":"always","prev":"*","next":"method"},{"blankLine":"always","prev":"method","next":"field"},{"blankLine":"never","prev":"field","next":"field"}]}],
1793
+ "logical-assignment-operators": ["error", "always", { enforceForIfStatements: true }],
1794
+ "max-depth": "warn",
1795
+ // "@stylistic/max-len":["warn",{"code":200,"ignoreComments":true,"ignoreUrls":true}],
1796
+ "max-lines": ["warn", { max: 1500, skipComments: true }],
1797
+ "max-nested-callbacks": ["warn", 4],
1798
+ "max-params": ["warn", { max: 4 }],
1799
+ // "@stylistic/max-statements-per-line":"error",
1800
+ "new-cap": ["error", { newIsCap: true, capIsNew: true }],
1801
+ // "@stylistic/multiline-ternary":["error","always-multiline"],
1802
+ // "@stylistic/new-parens":"error",
1803
+ "no-array-constructor": "error",
1804
+ "no-bitwise": "error",
1805
+ "no-lonely-if": "error",
1806
+ // "@stylistic/no-mixed-operators":"error",
1807
+ // "@stylistic/no-mixed-spaces-and-tabs":"error",
1808
+ "no-multi-assign": "error",
1809
+ // "@stylistic/no-multiple-empty-lines":["error",{"max":1}],
1810
+ "no-negated-condition": "error",
1811
+ // "@stylistic/no-whitespace-before-property":"error",
1812
+ // "@stylistic/no-trailing-spaces":"error",
1813
+ "no-unneeded-ternary": "error",
1814
+ // "@stylistic/object-curly-spacing":["error","never"],
1815
+ // "@stylistic/object-curly-newline":["error",{"ObjectExpression":{"multiline":true,"minProperties":4,"consistent":true},"ObjectPattern":{"multiline":true,"consistent":true},"ImportDeclaration":{"multiline":true,"minProperties":4,"consistent":true},"ExportDeclaration":{"multiline":true,"minProperties":4,"consistent":true}}],
1816
+ "one-var": ["error", "never"],
1817
+ // "@stylistic/one-var-declaration-per-line":"error",
1818
+ "operator-assignment": ["error", "always"],
1819
+ // "@stylistic/operator-linebreak":["error","before"],
1820
+ // "@stylistic/padded-blocks":["error","never",{"allowSingleLineBlocks":false}],
1821
+ // "@stylistic/padding-line-between-statements":["error",{"blankLine":"always","prev":"multiline-block-like","next":"*"}],
1822
+ "prefer-exponentiation-operator": "error",
1823
+ "prefer-object-spread": "error",
1824
+ // "@stylistic/quote-props":["error","as-needed"],
1825
+ // "@stylistic/quotes":["error","single"],
1826
+ // "@stylistic/semi-spacing":["error",{"before":false,"after":true}],
1827
+ // "@stylistic/semi-style":["error","last"],
1828
+ // "@stylistic/semi":["error","always"],
1829
+ // "@stylistic/space-before-blocks":["error","always"],
1830
+ // "@stylistic/space-before-function-paren":["error",{"anonymous":"always","named":"never","asyncArrow":"always"}],
1831
+ // "@stylistic/space-in-parens":["error","never"],
1832
+ // "@stylistic/space-infix-ops":"error",
1833
+ // "@stylistic/space-unary-ops":"error",
1834
+ // "@stylistic/spaced-comment":["error","always",{"line":{"exceptions":["-","+","*"],"markers":["!","/","=>"]},"block":{"exceptions":["-","+","*"],"markers":["!","*"],"balanced":true}}],
1835
+ // "@stylistic/switch-colon-spacing":["error",{"after":true,"before":false}],
1836
+ // "@stylistic/template-tag-spacing":["error","never"],
1837
+ "unicode-bom": ["error", "never"],
1838
+ "arrow-body-style": "error",
1839
+ // "@stylistic/arrow-parens":["error","as-needed"],
1840
+ // "@stylistic/arrow-spacing":["error",{"before":true,"after":true}],
1841
+ // "@stylistic/block-spacing":["error","never"],
1842
+ "constructor-super": "error",
1843
+ // "@stylistic/generator-star-spacing":["error","both"],
1844
+ "no-class-assign": "error",
1845
+ "no-const-assign": "error",
1846
+ "no-constant-binary-expression": "error",
1847
+ "no-dupe-class-members": "error",
1848
+ "no-new-native-nonconstructor": "error",
1849
+ "no-this-before-super": "error",
1850
+ "no-useless-computed-key": ["error", { enforceForClassMembers: true }],
1851
+ "no-useless-constructor": "error",
1852
+ "no-useless-rename": "error",
1853
+ "no-var": "error",
1854
+ "object-shorthand": ["error", "always", { avoidExplicitReturnArrows: true }],
1855
+ "prefer-arrow-callback": ["error", { allowNamedFunctions: true }],
1856
+ "prefer-const": ["error", { destructuring: "all" }],
1857
+ "prefer-destructuring": [
1858
+ "error",
1859
+ {
1860
+ VariableDeclarator: { array: false, object: true },
1861
+ AssignmentExpression: { array: false, object: false }
1862
+ },
1863
+ { enforceForRenamedProperties: false }
1864
+ ],
1865
+ "prefer-numeric-literals": "error",
1866
+ "prefer-object-has-own": "error",
1867
+ "prefer-rest-params": "error",
1868
+ "prefer-spread": "error",
1869
+ "require-yield": "error",
1870
+ // "@stylistic/rest-spread-spacing":["error","never"],
1871
+ "symbol-description": "error"
1872
+ // "@stylistic/template-curly-spacing":"error",
1873
+ // "@stylistic/yield-star-spacing":["error","both"],
1874
+ // "@stylistic/indent-binary-ops":["error","tab"],
1875
+ // End expansion
1876
+ };
1877
+ var xoTypescriptRules = {
1878
+ // Begin expansion 'eslint-config-xo-typescript' '[1].rules'
1879
+ "ts/adjacent-overload-signatures": "error",
1880
+ "ts/array-type": ["error", { default: "array-simple" }],
1881
+ "ts/await-thenable": "error",
1882
+ "ts/ban-ts-comment": [
1883
+ "error",
1884
+ { "ts-expect-error": "allow-with-description", minimumDescriptionLength: 4 }
1885
+ ],
1886
+ "ts/ban-tslint-comment": "error",
1887
+ "ts/no-restricted-types": [
1888
+ "error",
1889
+ {
1890
+ types: {
1891
+ object: {
1892
+ message: "The `object` type is hard to use. Use `Record<string, unknown>` instead. See: https://github.com/typescript-eslint/typescript-eslint/pull/848",
1893
+ fixWith: "Record<string, unknown>"
1894
+ },
1895
+ null: {
1896
+ message: "Use `undefined` instead. See: https://github.com/sindresorhus/meta/issues/7",
1897
+ fixWith: "undefined"
1898
+ },
1899
+ Buffer: {
1900
+ message: "Use Uint8Array instead. See: https://sindresorhus.com/blog/goodbye-nodejs-buffer",
1901
+ suggest: ["Uint8Array"]
1902
+ },
1903
+ "[]": "Don't use the empty array type `[]`. It only allows empty arrays. Use `SomeType[]` instead.",
1904
+ "[[]]": "Don't use `[[]]`. It only allows an array with a single element which is an empty array. Use `SomeType[][]` instead.",
1905
+ "[[[]]]": "Don't use `[[[]]]`. Use `SomeType[][][]` instead.",
1906
+ "[[[[]]]]": "ur drunk \u{1F921}",
1907
+ "[[[[[]]]]]": "\u{1F984}\u{1F4A5}"
1908
+ }
1909
+ }
1910
+ ],
1911
+ "ts/class-literal-property-style": ["error", "getters"],
1912
+ "ts/consistent-generic-constructors": ["error", "constructor"],
1913
+ "ts/consistent-indexed-object-style": "error",
1914
+ "brace-style": "off",
1915
+ // "@stylistic/brace-style":["error","1tbs",{"allowSingleLine":false}],
1916
+ "comma-dangle": "off",
1917
+ // "@stylistic/comma-dangle":["error","always-multiline"],
1918
+ "comma-spacing": "off",
1919
+ // "@stylistic/comma-spacing":["error",{"before":false,"after":true}],
1920
+ "default-param-last": "off",
1921
+ "ts/default-param-last": "error",
1922
+ "dot-notation": "off",
1923
+ "ts/dot-notation": "error",
1924
+ "ts/consistent-type-assertions": [
1925
+ "error",
1926
+ { assertionStyle: "as", objectLiteralTypeAssertions: "allow-as-parameter" }
1927
+ ],
1928
+ "ts/consistent-type-definitions": ["error", "type"],
1929
+ "ts/consistent-type-exports": ["error", { fixMixedExportsWithInlineTypeSpecifier: true }],
1930
+ "ts/consistent-type-imports": ["error", { fixStyle: "inline-type-imports" }],
1931
+ "func-call-spacing": "off",
1932
+ // "@stylistic/func-call-spacing":["error","never"],
1933
+ indent: "off",
1934
+ // "@stylistic/indent":["error","tab",{"SwitchCase":1}],
1935
+ "keyword-spacing": "off",
1936
+ // "@stylistic/keyword-spacing":"error",
1937
+ "lines-between-class-members": "off",
1938
+ // "@stylistic/lines-between-class-members":["error","always",{"exceptAfterSingleLine":true}],
1939
+ // "@stylistic/member-delimiter-style":["error",{"multiline":{"delimiter":"semi","requireLast":true},"singleline":{"delimiter":"semi","requireLast":false}}],
1940
+ "ts/member-ordering": [
1941
+ "error",
1942
+ {
1943
+ default: [
1944
+ "signature",
1945
+ "public-static-field",
1946
+ "public-static-method",
1947
+ "protected-static-field",
1948
+ "protected-static-method",
1949
+ "private-static-field",
1950
+ "private-static-method",
1951
+ "static-field",
1952
+ "static-method",
1953
+ "public-decorated-field",
1954
+ "public-instance-field",
1955
+ "public-abstract-field",
1956
+ "public-field",
1957
+ "protected-decorated-field",
1958
+ "protected-instance-field",
1959
+ "protected-abstract-field",
1960
+ "protected-field",
1961
+ "private-decorated-field",
1962
+ "private-instance-field",
1963
+ "private-field",
1964
+ "instance-field",
1965
+ "abstract-field",
1966
+ "decorated-field",
1967
+ "field",
1968
+ "public-constructor",
1969
+ "protected-constructor",
1970
+ "private-constructor",
1971
+ "constructor",
1972
+ "public-decorated-method",
1973
+ "public-instance-method",
1974
+ "public-abstract-method",
1975
+ "public-method",
1976
+ "protected-decorated-method",
1977
+ "protected-instance-method",
1978
+ "protected-abstract-method",
1979
+ "protected-method",
1980
+ "private-decorated-method",
1981
+ "private-instance-method",
1982
+ "private-method",
1983
+ "instance-method",
1984
+ "abstract-method",
1985
+ "decorated-method",
1986
+ "method"
1987
+ ]
1988
+ }
1989
+ ],
1990
+ camelcase: "off",
1991
+ "ts/naming-convention": [
1992
+ "error",
1993
+ {
1994
+ selector: [
1995
+ "variable",
1996
+ "function",
1997
+ "classProperty",
1998
+ "objectLiteralProperty",
1999
+ "parameterProperty",
2000
+ "classMethod",
2001
+ "objectLiteralMethod",
2002
+ "typeMethod",
2003
+ "accessor"
2004
+ ],
2005
+ format: ["strictCamelCase"],
2006
+ leadingUnderscore: "allowSingleOrDouble",
2007
+ trailingUnderscore: "allow",
2008
+ filter: { regex: "[- ]", match: false }
2009
+ },
2010
+ { selector: "typeLike", format: ["StrictPascalCase"] },
2011
+ {
2012
+ selector: "variable",
2013
+ types: ["boolean"],
2014
+ format: ["StrictPascalCase"],
2015
+ prefix: ["is", "has", "can", "should", "will", "did"]
2016
+ },
2017
+ { selector: "interface", filter: "^(?!I)[A-Z]", format: ["StrictPascalCase"] },
2018
+ { selector: "typeParameter", filter: "^T$|^[A-Z][a-zA-Z]+$", format: ["StrictPascalCase"] },
2019
+ {
2020
+ selector: ["classProperty", "objectLiteralProperty"],
2021
+ format: null,
2022
+ modifiers: ["requiresQuotes"]
2023
+ }
2024
+ ],
2025
+ "ts/no-base-to-string": "error",
2026
+ "no-array-constructor": "off",
2027
+ "ts/no-array-constructor": "error",
2028
+ "ts/no-array-delete": "error",
2029
+ "no-dupe-class-members": "off",
2030
+ "ts/no-dupe-class-members": "error",
2031
+ "ts/no-confusing-void-expression": "error",
2032
+ "ts/no-deprecated": "error",
2033
+ "ts/no-duplicate-enum-values": "error",
2034
+ "ts/no-duplicate-type-constituents": "error",
2035
+ "ts/no-dynamic-delete": "error",
2036
+ "no-empty-function": "off",
2037
+ "ts/no-empty-function": "error",
2038
+ "ts/no-empty-interface": ["error", { allowSingleExtends: true }],
2039
+ "ts/no-empty-object-type": "error",
2040
+ "ts/no-extra-non-null-assertion": "error",
2041
+ "no-extra-parens": "off",
2042
+ "no-extra-semi": "off",
2043
+ // "@stylistic/no-extra-semi":"error",
2044
+ "no-loop-func": "off",
2045
+ "ts/no-loop-func": "error",
2046
+ "ts/no-extraneous-class": [
2047
+ "error",
2048
+ {
2049
+ allowConstructorOnly: false,
2050
+ allowEmpty: false,
2051
+ allowStaticOnly: false,
2052
+ allowWithDecorator: true
2053
+ }
2054
+ ],
2055
+ "no-void": ["error", { allowAsStatement: true }],
2056
+ "ts/no-floating-promises": [
2057
+ "error",
2058
+ { checkThenables: true, ignoreVoid: true, ignoreIIFE: true }
2059
+ ],
2060
+ "ts/no-for-in-array": "error",
2061
+ "ts/no-inferrable-types": "error",
2062
+ "ts/no-meaningless-void-operator": "error",
2063
+ "ts/no-misused-new": "error",
2064
+ "ts/no-misused-promises": ["error", { checksConditionals: true, checksVoidReturn: false }],
2065
+ "ts/no-namespace": "error",
2066
+ "ts/no-non-null-asserted-nullish-coalescing": "error",
2067
+ "ts/no-non-null-asserted-optional-chain": "error",
2068
+ "no-redeclare": "off",
2069
+ "ts/no-redeclare": "error",
2070
+ "no-restricted-imports": "off",
2071
+ "ts/no-restricted-imports": [
2072
+ "error",
2073
+ {
2074
+ paths: ["error", "domain", "freelist", "smalloc", "punycode", "sys", "querystring", "colors"]
2075
+ }
2076
+ ],
2077
+ "ts/no-require-imports": "error",
2078
+ "ts/no-this-alias": ["error", { allowDestructuring: true }],
2079
+ "no-throw-literal": "off",
2080
+ "ts/only-throw-error": ["error", { allowThrowingUnknown: true, allowThrowingAny: false }],
2081
+ "ts/no-unnecessary-boolean-literal-compare": "error",
2082
+ "no-constant-condition": "error",
2083
+ "ts/no-unnecessary-parameter-property-assignment": "error",
2084
+ "ts/no-unnecessary-qualifier": "error",
2085
+ "ts/no-unnecessary-type-arguments": "error",
2086
+ "ts/no-unnecessary-type-assertion": "error",
2087
+ "ts/no-unnecessary-type-constraint": "error",
2088
+ "ts/no-unsafe-argument": "error",
2089
+ "ts/no-unsafe-assignment": "error",
2090
+ "ts/no-unsafe-call": "error",
2091
+ "ts/no-unsafe-declaration-merging": "error",
2092
+ "ts/no-unsafe-enum-comparison": "error",
2093
+ "ts/no-unsafe-function-type": "error",
2094
+ "ts/no-unsafe-return": "error",
2095
+ "ts/no-useless-empty-export": "error",
2096
+ "no-unused-expressions": "off",
2097
+ "ts/no-unused-expressions": "error",
2098
+ "no-unused-vars": "off",
2099
+ "no-useless-constructor": "off",
2100
+ "ts/no-useless-constructor": "error",
2101
+ "object-curly-spacing": "off",
2102
+ // "@stylistic/object-curly-spacing":["error","never"],
2103
+ "padding-line-between-statements": "off",
2104
+ // "@stylistic/padding-line-between-statements":["error",{"blankLine":"always","prev":"multiline-block-like","next":"*"}],
2105
+ "ts/no-wrapper-object-types": "error",
2106
+ "ts/non-nullable-type-assertion-style": "error",
2107
+ "ts/parameter-properties": ["error", { prefer: "parameter-property" }],
2108
+ "ts/prefer-as-const": "error",
2109
+ "ts/prefer-find": "error",
2110
+ "ts/prefer-for-of": "error",
2111
+ "ts/prefer-function-type": "error",
2112
+ "ts/prefer-includes": "error",
2113
+ "ts/prefer-literal-enum-member": "error",
2114
+ "ts/prefer-namespace-keyword": "error",
2115
+ "ts/prefer-nullish-coalescing": [
2116
+ "error",
2117
+ {
2118
+ ignoreTernaryTests: false,
2119
+ ignoreConditionalTests: false,
2120
+ ignoreMixedLogicalExpressions: false
2121
+ }
2122
+ ],
2123
+ "ts/prefer-optional-chain": "error",
2124
+ "prefer-promise-reject-errors": "off",
2125
+ "ts/prefer-promise-reject-errors": "error",
2126
+ "ts/prefer-readonly": "error",
2127
+ "ts/prefer-reduce-type-parameter": "error",
2128
+ "ts/prefer-string-starts-ends-with": "error",
2129
+ "ts/promise-function-async": "error",
2130
+ quotes: "off",
2131
+ // "@stylistic/quotes":["error","single"],
2132
+ "ts/restrict-plus-operands": ["error", { allowAny: false }],
2133
+ "ts/restrict-template-expressions": ["error", { allowNumber: true }],
2134
+ "ts/return-await": "error",
2135
+ "ts/require-array-sort-compare": ["error", { ignoreStringArrays: true }],
2136
+ "space-before-function-paren": "off",
2137
+ // "@stylistic/space-before-function-paren":["error",{"anonymous":"always","named":"never","asyncArrow":"always"}],
2138
+ "space-infix-ops": "off",
2139
+ // "@stylistic/space-infix-ops":"error",
2140
+ semi: "off",
2141
+ // "@stylistic/semi":["error","always"],
2142
+ "space-before-blocks": "off",
2143
+ // "@stylistic/space-before-blocks":["error","always"],
2144
+ "default-case": "off",
2145
+ "ts/switch-exhaustiveness-check": [
2146
+ "error",
2147
+ { allowDefaultCaseForExhaustiveSwitch: false, requireDefaultForNonUnion: true }
2148
+ ],
2149
+ "ts/triple-slash-reference": ["error", { path: "never", types: "never", lib: "never" }],
2150
+ // "@stylistic/type-annotation-spacing":"error",
2151
+ "ts/prefer-regexp-exec": "error",
2152
+ "ts/prefer-return-this-type": "error",
2153
+ "ts/unified-signatures": ["error", { ignoreDifferentlyNamedParameters: true }],
2154
+ "ts/use-unknown-in-catch-callback-variable": "error",
2155
+ // "@stylistic/type-generic-spacing":"error",
2156
+ // "@stylistic/type-named-tuple-spacing":"error",
2157
+ "no-undef": "off",
2158
+ "node/no-unsupported-features/es-syntax": "off",
2159
+ "node/no-unsupported-features/es-builtins": "off",
2160
+ "import/namespace": "off",
2161
+ "import/named": "off",
2162
+ "no-duplicate-imports": "off"
2163
+ // End expansion
2164
+ };
2165
+ var xoTypescriptDtsRules = {
2166
+ // Begin expansion 'eslint-config-xo-typescript' '[2].rules'
2167
+ "ts/no-unused-vars": "off"
2168
+ // End expansion
2169
+ };
2170
+ var xoTypescriptTestRules = {
2171
+ // Begin expansion 'eslint-config-xo-typescript' '[3].rules'
2172
+ "ts/no-unsafe-call": "off",
2173
+ "ts/no-confusing-void-expression": "off"
2174
+ // End expansion
2175
+ };
2176
+ var xoTsxRules = {
2177
+ // Begin expansion 'eslint-config-xo-typescript' '[4].rules'
2178
+ "ts/naming-convention": [
2179
+ "error",
2180
+ {
2181
+ selector: [
2182
+ "variable",
2183
+ "function",
2184
+ "classProperty",
2185
+ "objectLiteralProperty",
2186
+ "parameterProperty",
2187
+ "classMethod",
2188
+ "objectLiteralMethod",
2189
+ "typeMethod",
2190
+ "accessor"
2191
+ ],
2192
+ format: ["strictCamelCase", "StrictPascalCase"],
2193
+ leadingUnderscore: "allowSingleOrDouble",
2194
+ trailingUnderscore: "allow",
2195
+ filter: { regex: "[- ]", match: false }
2196
+ },
2197
+ { selector: "typeLike", format: ["StrictPascalCase"] },
2198
+ {
2199
+ selector: "variable",
2200
+ types: ["boolean"],
2201
+ format: ["StrictPascalCase"],
2202
+ prefix: ["is", "has", "can", "should", "will", "did"]
2203
+ },
2204
+ { selector: "interface", filter: "^(?!I)[A-Z]", format: ["StrictPascalCase"] },
2205
+ { selector: "typeParameter", filter: "^T$|^[A-Z][a-zA-Z]+$", format: ["StrictPascalCase"] },
2206
+ {
2207
+ selector: ["classProperty", "objectLiteralProperty"],
2208
+ format: null,
2209
+ modifiers: ["requiresQuotes"]
2210
+ }
2211
+ ]
2212
+ // End expansion
2213
+ };
2214
+
2215
+ // src/presets/yaml.ts
2216
+ var yamlRecommendedRules = {
2217
+ // Begin expansion 'eslint-plugin-yml' 'flat/recommended[2]'
2218
+ "yaml/no-empty-document": "error",
2219
+ "yaml/no-empty-key": "error",
2220
+ "yaml/no-empty-mapping-value": "error",
2221
+ "yaml/no-empty-sequence-entry": "error",
2222
+ "yaml/no-irregular-whitespace": "error",
2223
+ "yaml/no-tab-indent": "error",
2224
+ "yaml/vue-custom-block/no-parsing-error": "error"
2225
+ // End expansion
2226
+ };
2227
+
2228
+ // src/utils.ts
2229
+ import process2 from "node:process";
2230
+ async function combine(...configs) {
2231
+ const resolved = await Promise.all(configs);
2232
+ return resolved.flat();
2233
+ }
2234
+ async function interopDefault(m) {
2235
+ const resolved = await m;
2236
+ return resolved.default || resolved;
2237
+ }
2238
+ function isInEditorEnv() {
2239
+ if (process2.env.CI) return false;
2240
+ if (isInGitHooksOrLintStaged()) return false;
2241
+ const editorEnvVariables = [
2242
+ process2.env.VSCODE_PID,
2243
+ process2.env.VSCODE_CWD,
2244
+ process2.env.JETBRAINS_IDE,
2245
+ process2.env.VIM,
2246
+ process2.env.NVIM
2247
+ ];
2248
+ return editorEnvVariables.some(Boolean);
2249
+ }
2250
+ function isInGitHooksOrLintStaged() {
2251
+ const isLintStaged = process2.env.npm_lifecycle_script?.startsWith("lint-staged");
2252
+ const gitEnvVariables = [process2.env.GIT_PARAMS, process2.env.VSCODE_GIT_COMMAND, isLintStaged];
2253
+ return gitEnvVariables.some(Boolean);
2254
+ }
2255
+ function renamePluginInConfigs(configs, map) {
2256
+ return configs.map((i) => {
2257
+ const clone = { ...i };
2258
+ clone.rules &&= renameRules(clone.rules, map);
2259
+ clone.plugins &&= Object.fromEntries(
2260
+ Object.entries(clone.plugins).map(([key, value]) => {
2261
+ if (key in map) return [map[key], value];
2262
+ return [key, value];
2263
+ })
2264
+ );
2265
+ return clone;
2266
+ });
2267
+ }
2268
+ function renameRules(rules, map) {
2269
+ return Object.fromEntries(
2270
+ Object.entries(rules).map(([key, value]) => {
2271
+ for (const [from, to] of Object.entries(map)) {
2272
+ if (key.startsWith(`${from}/`)) return [to + key.slice(from.length), value];
2273
+ }
2274
+ return [key, value];
2275
+ })
2276
+ );
2277
+ }
2278
+ function toArray(value) {
2279
+ return Array.isArray(value) ? value : [value];
2280
+ }
2281
+ function generatePerfectionistSortConfig(strings, options) {
2282
+ const customGroups = {};
2283
+ for (const string of strings) {
2284
+ customGroups[string] = options?.matchTrailing ? `^.*${string}$` : `^${string}$`;
2285
+ }
2286
+ const exactMatch = strings.join("|");
2287
+ const pattern = options?.matchTrailing ? `^.+(${strings.map((s) => s).join("|")})$` : `^${exactMatch}$`;
2288
+ return {
2289
+ customGroups,
2290
+ groups: strings,
2291
+ useConfigurationIf: {
2292
+ allNamesMatchPattern: pattern
2293
+ }
2294
+ };
2295
+ }
2296
+
2297
+ // src/configs/shared-js-ts.ts
2298
+ import { default as pluginEslintComments } from "@eslint-community/eslint-plugin-eslint-comments";
2299
+ import { default as pluginTs } from "@typescript-eslint/eslint-plugin";
2300
+ import { createTypeScriptImportResolver } from "eslint-import-resolver-typescript";
2301
+ import * as pluginDepend from "eslint-plugin-depend";
2302
+ import { default as pluginImport } from "eslint-plugin-import-x";
2303
+ import { default as pluginJsdocComments } from "eslint-plugin-jsdoc";
2304
+ import { default as pluginNode } from "eslint-plugin-n";
2305
+ import { default as pluginPerfectionist } from "eslint-plugin-perfectionist";
2306
+ import * as pluginRegexp from "eslint-plugin-regexp";
2307
+ import { default as pluginUnicorn } from "eslint-plugin-unicorn";
2308
+ var kpSharedDisableTypeCheckedRules = {
2309
+ "jsdoc/check-tag-names": ["error", { typed: false }],
2310
+ "jsdoc/no-types": "off"
2311
+ };
2312
+ var sharedScriptConfig = {
2313
+ plugins: {
2314
+ depend: pluginDepend,
2315
+ // eslint-disable-next-line ts/no-unsafe-assignment
2316
+ "eslint-comments": pluginEslintComments,
2317
+ import: pluginImport,
2318
+ jsdoc: pluginJsdocComments,
2319
+ node: pluginNode,
2320
+ perfectionist: pluginPerfectionist,
2321
+ regexp: pluginRegexp,
2322
+ ts: pluginTs,
2323
+ unicorn: pluginUnicorn
2324
+ },
2325
+ rules: {
2326
+ ...eslintJavascriptRecommendedRules,
2327
+ ...eslintTypescriptRecommendedOverridesRules,
2328
+ ...eslintTypescriptStrictTypeCheckedRules,
2329
+ ...eslintTypescriptStylisticTypeCheckedRules,
2330
+ ...nodeRecommendedRules,
2331
+ ...unicornRecommendedRules,
2332
+ ...xoJavascriptRules,
2333
+ ...xoTypescriptRules,
2334
+ ...importRecommendedRules,
2335
+ ...importTypescriptRules,
2336
+ ...perfectionistRecommendedNaturalRules,
2337
+ ...jsdocCommentsRecommendedTypescriptFlavorRules,
2338
+ ...jsdocCommentsRecommendedTypescriptRules,
2339
+ ...eslintCommentsRecommendedRules,
2340
+ ...regexpRecommendedRules,
2341
+ ...dependRecommendedRules,
2342
+ "capitalized-comments": [
2343
+ "error",
2344
+ "always",
2345
+ {
2346
+ ignoreConsecutiveComments: true,
2347
+ ignoreInlineComments: true,
2348
+ // Forgive some additional common patterns arising from temporarily commenting out lines of code
2349
+ ignorePattern: String.raw`await|const|let|var|import|export|pragma|ignore|prettier-ignore|webpack\w+:|c8|type-coverage:`
2350
+ }
2351
+ ],
2352
+ "eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }],
2353
+ "import/order": "off",
2354
+ // Conflicts with perfectionist/sort-imports (but never enabled)
2355
+ "jsdoc/require-description": ["error", { descriptionStyle: "body" }],
2356
+ "jsdoc/require-jsdoc": [
2357
+ "error",
2358
+ {
2359
+ publicOnly: true
2360
+ }
2361
+ ],
2362
+ "max-params": ["warn", { max: 8 }],
2363
+ "no-await-in-loop": "off",
2364
+ "no-unreachable": "warn",
2365
+ // TSConfig must have allowUnreachableCode: false, this is preferable because it will flag but not spontaneously delete unreachable code
2366
+ "no-warning-comments": "off",
2367
+ "node/hashbang": "off",
2368
+ "node/no-extraneous-import": "off",
2369
+ "node/no-missing-import": "off",
2370
+ // Trouble resolving in ts
2371
+ "node/no-process-exit": "off",
2372
+ // Duplicated in unicorn
2373
+ "node/no-unsupported-features/node-builtins": ["error", { ignores: ["fs/promises.glob"] }],
2374
+ "perfectionist/sort-imports": [
2375
+ "error",
2376
+ {
2377
+ newlinesBetween: "never",
2378
+ partitionByComment: {
2379
+ block: false,
2380
+ line: true
2381
+ }
2382
+ }
2383
+ ],
2384
+ // Too chaotic... but should revisit
2385
+ "perfectionist/sort-modules": "off",
2386
+ "perfectionist/sort-objects": [
2387
+ "error",
2388
+ generatePerfectionistSortConfig(["X", "Y", "Z", "W"], { matchTrailing: true }),
2389
+ generatePerfectionistSortConfig(["Min", "Max"], { matchTrailing: true }),
2390
+ generatePerfectionistSortConfig(["Width", "Height"], { matchTrailing: true }),
2391
+ generatePerfectionistSortConfig(["r", "g", "b"]),
2392
+ generatePerfectionistSortConfig(["h", "s", "l"]),
2393
+ generatePerfectionistSortConfig(["h", "s", "l", "a"]),
2394
+ generatePerfectionistSortConfig(["h", "s", "v"]),
2395
+ generatePerfectionistSortConfig(["a", "b"]),
2396
+ // For partial matches...
2397
+ generatePerfectionistSortConfig(["r", "g", "b", "a"]),
2398
+ generatePerfectionistSortConfig(["x", "y", "z", "w"]),
2399
+ generatePerfectionistSortConfig(["min", "max"]),
2400
+ generatePerfectionistSortConfig(["width", "height"]),
2401
+ { newlinesBetween: "never", order: "asc", type: "natural" }
2402
+ ],
2403
+ "sort-imports": "off",
2404
+ // Conflicts with perfectionist/sort-imports (but never enabled)
2405
+ "ts/adjacent-overload-signatures": "off",
2406
+ // Conflicts with perfectionist/sort-interfaces
2407
+ "ts/naming-convention": [
2408
+ // https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/naming-convention.md
2409
+ "error",
2410
+ // Group selectors
2411
+ {
2412
+ format: ["camelCase"],
2413
+ // Matches everything
2414
+ selector: "default"
2415
+ },
2416
+ {
2417
+ format: null,
2418
+ modifiers: ["requiresQuotes"],
2419
+ // Forgive quoted things
2420
+ selector: "default"
2421
+ },
2422
+ {
2423
+ format: ["StrictPascalCase"],
2424
+ // Matches the same as class, enum, interface, typeAlias, typeParameter
2425
+ selector: "typeLike"
2426
+ },
2427
+ {
2428
+ format: ["camelCase"],
2429
+ leadingUnderscore: "allow",
2430
+ // Matches the same as function, parameter and variable
2431
+ selector: "variableLike",
2432
+ trailingUnderscore: "allow"
2433
+ },
2434
+ {
2435
+ format: ["camelCase", "StrictPascalCase"],
2436
+ selector: "import"
2437
+ },
2438
+ {
2439
+ format: ["camelCase", "StrictPascalCase"],
2440
+ modifiers: ["destructured"],
2441
+ // Allow Component import
2442
+ selector: "variable"
2443
+ },
2444
+ {
2445
+ format: ["UPPER_CASE", "camelCase"],
2446
+ modifiers: ["const", "exported"],
2447
+ // Allow UPPER_CASE const exports
2448
+ selector: "variable"
2449
+ }
2450
+ // {
2451
+ // filter: {
2452
+ // match: true,
2453
+ // regex: '/',
2454
+ // },
2455
+ // format: null,
2456
+ // selector: 'objectLiteralProperty',
2457
+ // },
2458
+ ],
2459
+ "ts/no-non-null-assertion": "off",
2460
+ "ts/no-unused-vars": [
2461
+ "error",
2462
+ {
2463
+ args: "after-used",
2464
+ argsIgnorePattern: "^_",
2465
+ caughtErrors: "all",
2466
+ caughtErrorsIgnorePattern: "^_$",
2467
+ destructuredArrayIgnorePattern: "^_",
2468
+ ignoreRestSiblings: true,
2469
+ vars: "all",
2470
+ varsIgnorePattern: "^_"
2471
+ }
2472
+ ],
2473
+ "ts/sort-type-constituents": "off",
2474
+ // Conflicts with perfectionist/sort-intersection-types
2475
+ "unicorn/prevent-abbreviations": [
2476
+ "error",
2477
+ {
2478
+ replacements: {
2479
+ acc: false,
2480
+ arg: false,
2481
+ args: false,
2482
+ db: false,
2483
+ dev: false,
2484
+ doc: false,
2485
+ docs: false,
2486
+ env: false,
2487
+ fn: false,
2488
+ i: false,
2489
+ j: false,
2490
+ lib: false,
2491
+ param: false,
2492
+ params: false,
2493
+ pkg: false,
2494
+ prop: false,
2495
+ props: false,
2496
+ ref: false,
2497
+ refs: false,
2498
+ src: false,
2499
+ temp: false
2500
+ }
2501
+ }
2502
+ ]
2503
+ },
2504
+ settings: {
2505
+ // Do NOT need to rename these settings
2506
+ // From pluginImport.flatConfigs.typescript.settings,
2507
+ "import-x/extensions": [".ts", ".tsx", ".cts", ".mts", ".js", ".jsx", ".cjs", ".mjs"],
2508
+ "import-x/external-module-folders": ["node_modules", "node_modules/@types"],
2509
+ "import-x/parsers": {
2510
+ "@typescript-eslint/parser": [".ts", ".tsx", ".cts", ".mts"]
2511
+ },
2512
+ // 'import-x/resolver': { typescript: true },
2513
+ "import-x/resolver-next": [
2514
+ createTypeScriptImportResolver({
2515
+ alwaysTryTypes: true,
2516
+ project: [
2517
+ // Useful for monorepos
2518
+ "packages/*/tsconfig.json",
2519
+ "<root>/tsconfig.json"
2520
+ ]
2521
+ })
2522
+ ]
2523
+ }
2524
+ };
2525
+ var sharedScriptDisableTypeCheckedRules = {
2526
+ ...eslintTypescriptDisableTypeCheckedRules,
2527
+ ...kpSharedDisableTypeCheckedRules
2528
+ };
2529
+
2530
+ // src/configs/astro.ts
2531
+ async function astro(options = {}) {
2532
+ const {
2533
+ overrides = {},
2534
+ overridesEmbeddedScripts = {},
2535
+ typeAware = {
2536
+ enabled: true,
2537
+ ignores: []
2538
+ }
2539
+ } = options;
2540
+ const [pluginAstro, parserAstro] = await Promise.all([
2541
+ interopDefault(import("eslint-plugin-astro")),
2542
+ interopDefault(import("astro-eslint-parser"))
2543
+ ]);
2544
+ return [
2545
+ {
2546
+ name: "kp/astro/setup",
2547
+ plugins: {
2548
+ astro: pluginAstro
2549
+ }
2550
+ },
2551
+ {
2552
+ // Includes plugins...
2553
+ ...sharedScriptConfig,
2554
+ files: [GLOB_ASTRO],
2555
+ languageOptions: {
2556
+ globals: {
2557
+ ...globals.nodeBuiltin,
2558
+ // TODO plugin itself uses .node in its config?
2559
+ ...pluginAstro.environments.astro.globals
2560
+ },
2561
+ parser: parserAstro,
2562
+ parserOptions: {
2563
+ extraFileExtensions: [".astro"],
2564
+ parser: tsParser,
2565
+ ...typeAware.enabled ? {
2566
+ // Not yet compatible with projectService
2567
+ project: path.join(process3.cwd(), "tsconfig.json")
2568
+ // Not sure why this isn't inherited
2569
+ } : {
2570
+ project: void 0
2571
+ }
2572
+ }
2573
+ },
2574
+ name: "kp/astro/rules",
2575
+ processor: "astro/client-side-ts",
2576
+ rules: {
2577
+ ...sharedScriptConfig.rules,
2578
+ ...astroRecommendedRules,
2579
+ ...astroJsxA11yRecommendedRules,
2580
+ // TODO right spot?
2581
+ // 'ts/no-unsafe-assignment': 'off', // Crashing
2582
+ "ts/no-unsafe-return": "off",
2583
+ // Happens in templates
2584
+ // Astro components are usually PascalCase,
2585
+ // but when used as pages they are kebab-case
2586
+ "unicorn/filename-case": [
2587
+ "error",
2588
+ {
2589
+ cases: {
2590
+ kebabCase: true,
2591
+ pascalCase: true
2592
+ },
2593
+ ignore: [String.raw`^\[slug\]\.astro$`]
2594
+ }
2595
+ ],
2596
+ ...overrides
2597
+ }
2598
+ },
2599
+ typeAware.ignores.length > 0 ? {
2600
+ files: typeAware.ignores,
2601
+ languageOptions: {
2602
+ parserOptions: {
2603
+ project: void 0,
2604
+ projectService: false
2605
+ }
2606
+ },
2607
+ name: "kp/astro/disable-type-aware",
2608
+ rules: {
2609
+ ...sharedScriptDisableTypeCheckedRules
2610
+ }
2611
+ } : {},
2612
+ // Via https://github.com/ota-meshi/eslint-plugin-astro/blob/main/src/configs/flat/base.ts#L56
2613
+ {
2614
+ files: [GLOB_ASTRO_JS],
2615
+ languageOptions: {
2616
+ ecmaVersion: 2023,
2617
+ globals: {
2618
+ ...globals.browser
2619
+ },
2620
+ parser: void 0,
2621
+ sourceType: "module"
2622
+ },
2623
+ // Define the configuration for `<script>` tag.
2624
+ // Script in `<script>` is assigned a virtual file name with the `.js` extension.
2625
+ // This is unreachable since we use `client-side-ts` processor?
2626
+ name: "kp/astro/script-js",
2627
+ rules: {
2628
+ ...sharedScriptDisableTypeCheckedRules,
2629
+ ...overridesEmbeddedScripts
2630
+ }
2631
+ },
2632
+ {
2633
+ files: [GLOB_ASTRO_TS],
2634
+ languageOptions: {
2635
+ ecmaVersion: 2023,
2636
+ globals: {
2637
+ ...globals.browser
2638
+ },
2639
+ parser: tsParser,
2640
+ // No typed rules?
2641
+ parserOptions: {
2642
+ projectService: false
2643
+ },
2644
+ sourceType: "module"
2645
+ },
2646
+ // Define the configuration for `<script>` tag when using `client-side-ts` processor.
2647
+ // Script in `<script>` is assigned a virtual file name with the `.ts` extension.
2648
+ name: "kp/astro/script-ts",
2649
+ rules: {
2650
+ ...sharedScriptDisableTypeCheckedRules,
2651
+ ...overridesEmbeddedScripts
2652
+ }
2653
+ }
2654
+ ];
2655
+ }
2656
+
2657
+ // src/configs/disables.ts
2658
+ async function disables() {
2659
+ return [
2660
+ // TODO move this logic to js / typescript?
2661
+ // {
2662
+ // files: [`**/scripts/${GLOB_SRC}`],
2663
+ // name: 'kp/disables/scripts',
2664
+ // languageOptions: {
2665
+ // globals: globals.nodeBuiltin,
2666
+ // },
2667
+ // rules: {
2668
+ // 'node/hashbang': 'error',
2669
+ // },
2670
+ // },
2671
+ // {
2672
+ // files: [`**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
2673
+ // languageOptions: {
2674
+ // globals: globals.nodeBuiltin,
2675
+ // },
2676
+ // name: 'kp/disables/cli',
2677
+ // rules: {
2678
+ // 'no-console': 'off',
2679
+ // },
2680
+ // },
2681
+ // {
2682
+ // files: ['**/bin/**/*', `**/bin.${GLOB_SRC_EXT}`],
2683
+ // name: 'kp/disables/bin',
2684
+ // rules: {
2685
+ // },
2686
+ // },
2687
+ {
2688
+ files: ["**/*.d.?([cm])ts"],
2689
+ name: "kp/disables/dts",
2690
+ rules: {
2691
+ "eslint-comments/no-unlimited-disable": "off",
2692
+ "import/no-duplicates": "off",
2693
+ "no-restricted-syntax": "off"
2694
+ }
2695
+ },
2696
+ {
2697
+ files: ["**/*.cjs"],
2698
+ name: "kp/disables/cjs",
2699
+ rules: {
2700
+ "ts/no-require-imports": "off"
2701
+ }
2702
+ },
2703
+ // {
2704
+ // files: [`**/*.config.${GLOB_SRC_EXT}`, `**/*.config.*.${GLOB_SRC_EXT}`],
2705
+ // name: 'kp/disables/config-files',
2706
+ // rules: {
2707
+ // 'no-console': 'off',
2708
+ // 'ts/explicit-function-return-type': 'off',
2709
+ // },
2710
+ // },
2711
+ {
2712
+ name: "kp/disables/prettier",
2713
+ rules: {
2714
+ ...prettierRules
2715
+ }
2716
+ }
2717
+ ];
2718
+ }
2719
+
2720
+ // src/configs/html.ts
2721
+ import { default as pluginHtml } from "@html-eslint/eslint-plugin";
2722
+ import { default as htmlParser } from "@html-eslint/parser";
2723
+ import { default as pluginHtmlScript } from "eslint-plugin-html";
2724
+
2725
+ // src/presets/html.ts
2726
+ var htmlRecommendedRules = {
2727
+ // Begin expansion '@html-eslint/eslint-plugin' 'flat/recommended'
2728
+ "html/require-lang": "error",
2729
+ "html/require-img-alt": "error",
2730
+ "html/require-doctype": "error",
2731
+ "html/require-title": "error",
2732
+ "html/no-multiple-h1": "error",
2733
+ "html/no-extra-spacing-attrs": "error",
2734
+ "html/attrs-newline": "error",
2735
+ "html/element-newline": ["error", { inline: ["$inline"] }],
2736
+ "html/no-duplicate-id": "error",
2737
+ "html/indent": "error",
2738
+ "html/require-li-container": "error",
2739
+ "html/quotes": "error",
2740
+ "html/no-obsolete-tags": "error",
2741
+ "html/require-closing-tags": "error",
2742
+ "html/no-duplicate-attrs": "error"
2743
+ // End expansion
2744
+ };
2745
+
2746
+ // src/configs/html.ts
2747
+ async function html(options = {}) {
2748
+ const { overrides = {}, overridesEmbeddedScripts = {} } = options;
2749
+ const files = [GLOB_HTML];
2750
+ return [
2751
+ {
2752
+ // Only HTML files get the HTML script parser
2753
+ files,
2754
+ name: "kp/html-script",
2755
+ plugins: {
2756
+ // eslint-disable-next-line ts/no-unsafe-assignment
2757
+ "html-script": pluginHtmlScript
2758
+ },
2759
+ rules: {
2760
+ ...overridesEmbeddedScripts
2761
+ }
2762
+ },
2763
+ // Only HTML files get the HTML parser
2764
+ {
2765
+ files,
2766
+ languageOptions: {
2767
+ parser: htmlParser
2768
+ },
2769
+ name: "kp/html/setup",
2770
+ plugins: {
2771
+ html: pluginHtml
2772
+ }
2773
+ },
2774
+ {
2775
+ // All files get the rules, to include templates like html`` found in JS and TS files
2776
+ name: "kp/html",
2777
+ plugins: {
2778
+ html: pluginHtml
2779
+ },
2780
+ rules: {
2781
+ // Everything is overridden
2782
+ ...htmlRecommendedRules,
2783
+ "html/attrs-newline": "off",
2784
+ // Overrides recommended
2785
+ "html/element-newline": "off",
2786
+ // Overrides recommended
2787
+ "html/indent": "off",
2788
+ // Overrides recommended
2789
+ "html/no-abstract-roles": "error",
2790
+ "html/no-accesskey-attrs": "error",
2791
+ "html/no-aria-hidden-body": "error",
2792
+ "html/no-duplicate-attrs": "error",
2793
+ "html/no-duplicate-id": "error",
2794
+ "html/no-extra-spacing-attrs": "off",
2795
+ // Overrides recommended
2796
+ "html/no-inline-styles": "error",
2797
+ "html/no-multiple-h1": "error",
2798
+ "html/no-non-scalable-viewport": "error",
2799
+ "html/no-obsolete-tags": "error",
2800
+ "html/no-positive-tabindex": "error",
2801
+ "html/no-restricted-attr-values": "error",
2802
+ "html/no-restricted-attrs": "error",
2803
+ "html/no-script-style-type": "error",
2804
+ "html/no-skip-heading-levels": "error",
2805
+ "html/no-target-blank": "error",
2806
+ "html/quotes": "off",
2807
+ // Overrides recommended
2808
+ "html/require-attrs": "error",
2809
+ "html/require-button-type": "error",
2810
+ "html/require-closing-tags": "off",
2811
+ // Overrides recommended
2812
+ "html/require-doctype": "error",
2813
+ "html/require-frame-title": "error",
2814
+ "html/require-img-alt": "error",
2815
+ "html/require-lang": "error",
2816
+ "html/require-li-container": "error",
2817
+ "html/require-meta-charset": "error",
2818
+ "html/require-meta-viewport": "error",
2819
+ "html/require-title": "error",
2820
+ ...overrides
2821
+ }
2822
+ }
2823
+ ];
2824
+ }
2825
+
2826
+ // src/configs/ignores.ts
2827
+ async function ignores(userIgnores = []) {
2828
+ return [
2829
+ {
2830
+ ignores: [...GLOB_EXCLUDE, ...userIgnores],
2831
+ name: "kp/ignores"
2832
+ }
2833
+ ];
2834
+ }
2835
+
2836
+ // src/factory.ts
2837
+ import { FlatConfigComposer } from "eslint-flat-config-utils";
2838
+ import globals2 from "globals";
2839
+ import { isPackageExists } from "local-pkg";
2840
+ var flatConfigProperties = [
2841
+ "name",
2842
+ "languageOptions",
2843
+ "linterOptions",
2844
+ "processor",
2845
+ "plugins",
2846
+ "rules",
2847
+ "settings"
2848
+ ];
2849
+ var defaultPluginRenaming = {
2850
+ "@eslint-community/eslint-comments": "eslint-comments",
2851
+ "@eslint-react/debug": "react-debug",
2852
+ "@eslint-react/dom": "react-dom",
2853
+ "@eslint-react/hooks-extra": "react-hooks-extra",
2854
+ "@eslint-react/naming-convention": "react-naming-convention",
2855
+ "@eslint-react/web-api": "react-web-api",
2856
+ "@eslint-react": "react",
2857
+ jsonc: "json",
2858
+ "@html-eslint": "html",
2859
+ "package-json": "json-package",
2860
+ "@typescript-eslint": "ts",
2861
+ "import-x": "import",
2862
+ n: "node",
2863
+ vitest: "test",
2864
+ yml: "yaml"
2865
+ };
2866
+ async function eslintConfig(options = {}, ...userConfigs) {
2867
+ const {
2868
+ astro: enableAstro = isPackageExists("astro"),
2869
+ gitignore: enableGitignore = true,
2870
+ react: enableReact = isPackageExists("react"),
2871
+ svelte: enableSvelte = isPackageExists("svelte")
2872
+ } = options;
2873
+ let { isInEditor } = options;
2874
+ if (isInEditor === void 0) {
2875
+ isInEditor = isInEditorEnv();
2876
+ if (isInEditor)
2877
+ console.log(
2878
+ "[@kitschpatrol/eslint-config] Detected running in editor, some rules are disabled."
2879
+ );
2880
+ }
2881
+ const configs = [];
2882
+ if (enableGitignore) {
2883
+ if (typeof enableGitignore === "boolean") {
2884
+ configs.push(
2885
+ interopDefault(import("eslint-config-flat-gitignore")).then((r) => [
2886
+ r({
2887
+ name: "kp/gitignore",
2888
+ strict: false
2889
+ })
2890
+ ])
2891
+ );
2892
+ } else {
2893
+ configs.push(
2894
+ interopDefault(import("eslint-config-flat-gitignore")).then((r) => [
2895
+ r({
2896
+ name: "kp/gitignore",
2897
+ ...enableGitignore
2898
+ })
2899
+ ])
2900
+ );
2901
+ }
2902
+ }
2903
+ configs.push(
2904
+ ignores(options.ignores),
2905
+ [
2906
+ {
2907
+ linterOptions: {
2908
+ reportUnusedDisableDirectives: "error"
2909
+ }
2910
+ }
2911
+ ],
2912
+ js({
2913
+ typeAware: {
2914
+ enabled: true,
2915
+ // TODO check tsconfig...
2916
+ ignores: []
2917
+ },
2918
+ ...resolveSubOptions(options, "js"),
2919
+ overrides: getOverrides(options, "js")
2920
+ }),
2921
+ jsx({
2922
+ typeAware: {
2923
+ enabled: true,
2924
+ // TODO check tsconfig...
2925
+ ignores: []
2926
+ },
2927
+ ...resolveSubOptions(options, "jsx"),
2928
+ overrides: getOverrides(options, "jsx")
2929
+ }),
2930
+ ts({
2931
+ typeAware: {
2932
+ enabled: true,
2933
+ // TODO check tsconfig...
2934
+ ignores: []
2935
+ },
2936
+ ...resolveSubOptions(options, "ts"),
2937
+ overrides: getOverrides(options, "ts")
2938
+ }),
2939
+ tsx({
2940
+ typeAware: {
2941
+ enabled: true,
2942
+ // TODO check tsconfig...
2943
+ ignores: []
2944
+ },
2945
+ ...resolveSubOptions(options, "tsx"),
2946
+ overrides: getOverrides(options, "tsx")
2947
+ }),
2948
+ test({
2949
+ isInEditor,
2950
+ overrides: getOverrides(options, "test")
2951
+ }),
2952
+ json({
2953
+ overrides: getOverrides(options, "json")
2954
+ }),
2955
+ yaml({
2956
+ overrides: getOverrides(options, "yaml")
2957
+ }),
2958
+ toml({
2959
+ overrides: getOverrides(options, "toml")
2960
+ }),
2961
+ md({
2962
+ overrides: getOverrides(options, "md"),
2963
+ overridesEmbeddedScripts: getOverridesEmbeddedScripts(options, "md")
2964
+ }),
2965
+ mdx({
2966
+ overrides: getOverrides(options, "mdx"),
2967
+ overridesEmbeddedScripts: getOverridesEmbeddedScripts(options, "mdx")
2968
+ }),
2969
+ html({
2970
+ overrides: getOverrides(options, "html"),
2971
+ overridesEmbeddedScripts: getOverridesEmbeddedScripts(options, "html")
2972
+ })
2973
+ );
2974
+ if (enableReact) {
2975
+ configs.push(
2976
+ react({
2977
+ overrides: getOverrides(options, "react")
2978
+ })
2979
+ );
2980
+ }
2981
+ if (enableSvelte) {
2982
+ configs.push(
2983
+ svelte({
2984
+ overrides: getOverrides(options, "svelte")
2985
+ // TODO TS flag?
2986
+ })
2987
+ );
2988
+ }
2989
+ if (enableAstro) {
2990
+ configs.push(
2991
+ astro({
2992
+ overrides: getOverrides(options, "astro"),
2993
+ overridesEmbeddedScripts: getOverridesEmbeddedScripts(options, "astro")
2994
+ })
2995
+ );
2996
+ }
2997
+ configs.push(disables());
2998
+ if ("files" in options) {
2999
+ throw new Error(
3000
+ '[@kitschpatrol/eslint-config] The first argument should not contain the "files" property as the options are supposed to be global. Place it in the second or later config instead.'
3001
+ );
3002
+ }
3003
+ const fusedConfig = flatConfigProperties.reduce((accumulator, key) => {
3004
+ if (key in options) accumulator[key] = options[key];
3005
+ return accumulator;
3006
+ }, {});
3007
+ if (Object.keys(fusedConfig).length > 0) configs.push([fusedConfig]);
3008
+ let composer = new FlatConfigComposer();
3009
+ composer = composer.append(...configs, ...userConfigs);
3010
+ composer = composer.renamePlugins(defaultPluginRenaming);
3011
+ return composer;
3012
+ }
3013
+ function getLanguageOptions(typeAware = true, jsx2 = false) {
3014
+ return {
3015
+ ecmaVersion: 2023,
3016
+ globals: {
3017
+ ...globals2.browser,
3018
+ ...globals2.es2023,
3019
+ ...globals2.nodeBuiltin
3020
+ },
3021
+ // TODO Always use typescript parser to get type info for JavaScript files when checkjs is true?
3022
+ parser: tsParser,
3023
+ parserOptions: {
3024
+ ecmaFeatures: {
3025
+ impliedStrict: true,
3026
+ jsx: jsx2
3027
+ },
3028
+ ...typeAware ? {
3029
+ projectService: true,
3030
+ tsconfigRootDir: process.cwd()
3031
+ // TODO import.meta.dirname preferred?
3032
+ } : {
3033
+ projectService: false
3034
+ },
3035
+ ecmaVersion: 2023,
3036
+ sourceType: "module"
3037
+ }
3038
+ };
3039
+ }
3040
+ function getOverrides(options, key) {
3041
+ const sub = resolveSubOptions(options, key);
3042
+ return {
3043
+ ..."overrides" in sub ? sub.overrides : {}
3044
+ };
3045
+ }
3046
+ function getOverridesEmbeddedScripts(options, key) {
3047
+ const sub = resolveSubOptions(options, key);
3048
+ return {
3049
+ ..."overridesEmbeddedScripts" in sub ? sub.overridesEmbeddedScripts : {}
3050
+ };
3051
+ }
3052
+ function resolveSubOptions(options, key) {
3053
+ return typeof options[key] === "boolean" ? {} : options[key] || {};
3054
+ }
3055
+
3056
+ // src/configs/js.ts
3057
+ async function js(options = {}) {
3058
+ const {
3059
+ overrides = {},
3060
+ typeAware = {
3061
+ enabled: true,
3062
+ ignores: []
3063
+ }
3064
+ } = options;
3065
+ return [
3066
+ {
3067
+ // Includes plugins...
3068
+ ...sharedScriptConfig,
3069
+ files: [GLOB_JS],
3070
+ languageOptions: getLanguageOptions(typeAware.enabled, false),
3071
+ name: "kp/js/rules",
3072
+ rules: {
3073
+ ...sharedScriptConfig.rules,
3074
+ "jsdoc/check-tag-names": "off",
3075
+ "jsdoc/no-types": "off",
3076
+ ...typeAware.enabled ? {} : sharedScriptDisableTypeCheckedRules,
3077
+ ...overrides
3078
+ }
3079
+ },
3080
+ typeAware.enabled && typeAware.ignores.length > 0 ? {
3081
+ files: typeAware.ignores,
3082
+ languageOptions: getLanguageOptions(false, false),
3083
+ name: "kp/js/disable-type-aware",
3084
+ rules: {
3085
+ ...sharedScriptDisableTypeCheckedRules
3086
+ }
3087
+ } : {}
3088
+ ];
3089
+ }
3090
+
3091
+ // src/configs/json.ts
3092
+ import { default as pluginJson } from "eslint-plugin-jsonc";
3093
+ import pluginJsonPackage from "eslint-plugin-package-json";
3094
+ import { default as parserJson } from "jsonc-eslint-parser";
3095
+ async function json(options = {}) {
3096
+ const { overrides = {} } = options;
3097
+ return [
3098
+ // Jsonc plugin
3099
+ {
3100
+ name: "kp/json/setup",
3101
+ plugins: {
3102
+ json: pluginJson,
3103
+ "json-package": pluginJsonPackage
3104
+ }
3105
+ },
3106
+ {
3107
+ files: [GLOB_JSON],
3108
+ languageOptions: {
3109
+ parser: parserJson
3110
+ },
3111
+ name: "kp/json/rules-json",
3112
+ rules: {
3113
+ ...jsonRecommendedWithJsonRules
3114
+ }
3115
+ },
3116
+ {
3117
+ files: [GLOB_JSONC],
3118
+ languageOptions: {
3119
+ parser: parserJson
3120
+ },
3121
+ name: "kp/json/rules-jsonc",
3122
+ rules: {
3123
+ ...jsonRecommendedWithJsoncRules
3124
+ }
3125
+ },
3126
+ {
3127
+ files: [GLOB_JSON5],
3128
+ languageOptions: {
3129
+ parser: parserJson
3130
+ },
3131
+ name: "kp/json/rules-json5",
3132
+ rules: {
3133
+ ...jsonRecommendedWithJson5Rules
3134
+ }
3135
+ },
3136
+ {
3137
+ files: [GLOB_JSON, GLOB_JSONC, GLOB_JSON5],
3138
+ name: "kp/json/rules",
3139
+ rules: {
3140
+ ...jsonRecommendedWithJsonCommonRules,
3141
+ ...jsonPrettierRules
3142
+ }
3143
+ },
3144
+ // VS Code settings
3145
+ {
3146
+ files: [".vscode/**.json"],
3147
+ name: "kp/json/rules-settings",
3148
+ rules: {
3149
+ ...jsonRecommendedWithJsoncRules,
3150
+ "json/no-comments": "off"
3151
+ }
3152
+ },
3153
+ // Package json
3154
+ {
3155
+ // TODO parser situation? Fine since it's already inheriting parser from above?
3156
+ files: ["**/package.json"],
3157
+ name: "kp/json/rules-package",
3158
+ rules: {
3159
+ ...jsonPackageRecommendedRules,
3160
+ "json-package/no-redundant-files": "error",
3161
+ "json-package/order-properties": "error"
3162
+ }
3163
+ },
3164
+ // Sort tsconfig
3165
+ {
3166
+ files: [
3167
+ "**/tsconfig.json",
3168
+ "**/tsconfig.*.json",
3169
+ // Special case for boilerplate tsconfigs in
3170
+ // @kitschpatrol/typescript-config
3171
+ "**/tsconfigs/**/*.json"
3172
+ ],
3173
+ name: "kp/json/rules-tsconfig",
3174
+ rules: {
3175
+ "json/no-comments": "off",
3176
+ "json/sort-keys": [
3177
+ "error",
3178
+ {
3179
+ order: ["extends", "compilerOptions", "references", "files", "include", "exclude"],
3180
+ pathPattern: "^$"
3181
+ },
3182
+ {
3183
+ order: [
3184
+ /* Projects */
3185
+ "incremental",
3186
+ "composite",
3187
+ "tsBuildInfoFile",
3188
+ "disableSourceOfProjectReferenceRedirect",
3189
+ "disableSolutionSearching",
3190
+ "disableReferencedProjectLoad",
3191
+ /* Language and Environment */
3192
+ "target",
3193
+ "jsx",
3194
+ "jsxFactory",
3195
+ "jsxFragmentFactory",
3196
+ "jsxImportSource",
3197
+ "lib",
3198
+ "moduleDetection",
3199
+ "noLib",
3200
+ "reactNamespace",
3201
+ "useDefineForClassFields",
3202
+ "emitDecoratorMetadata",
3203
+ "experimentalDecorators",
3204
+ /* Modules */
3205
+ "baseUrl",
3206
+ "rootDir",
3207
+ "rootDirs",
3208
+ "customConditions",
3209
+ "module",
3210
+ "moduleResolution",
3211
+ "moduleSuffixes",
3212
+ "noResolve",
3213
+ "paths",
3214
+ "resolveJsonModule",
3215
+ "resolvePackageJsonExports",
3216
+ "resolvePackageJsonImports",
3217
+ "typeRoots",
3218
+ "types",
3219
+ "allowArbitraryExtensions",
3220
+ "allowImportingTsExtensions",
3221
+ "allowUmdGlobalAccess",
3222
+ /* JavaScript Support */
3223
+ "allowJs",
3224
+ "checkJs",
3225
+ "maxNodeModuleJsDepth",
3226
+ /* Type Checking */
3227
+ "strict",
3228
+ "strictBindCallApply",
3229
+ "strictFunctionTypes",
3230
+ "strictNullChecks",
3231
+ "strictPropertyInitialization",
3232
+ "allowUnreachableCode",
3233
+ "allowUnusedLabels",
3234
+ "alwaysStrict",
3235
+ "exactOptionalPropertyTypes",
3236
+ "noFallthroughCasesInSwitch",
3237
+ "noImplicitAny",
3238
+ "noImplicitOverride",
3239
+ "noImplicitReturns",
3240
+ "noImplicitThis",
3241
+ "noPropertyAccessFromIndexSignature",
3242
+ "noUncheckedIndexedAccess",
3243
+ "noUnusedLocals",
3244
+ "noUnusedParameters",
3245
+ "useUnknownInCatchVariables",
3246
+ /* Emit */
3247
+ "declaration",
3248
+ "declarationDir",
3249
+ "declarationMap",
3250
+ "downlevelIteration",
3251
+ "emitBOM",
3252
+ "emitDeclarationOnly",
3253
+ "importHelpers",
3254
+ "importsNotUsedAsValues",
3255
+ "inlineSourceMap",
3256
+ "inlineSources",
3257
+ "mapRoot",
3258
+ "newLine",
3259
+ "noEmit",
3260
+ "noEmitHelpers",
3261
+ "noEmitOnError",
3262
+ "outDir",
3263
+ "outFile",
3264
+ "preserveConstEnums",
3265
+ "preserveValueImports",
3266
+ "removeComments",
3267
+ "sourceMap",
3268
+ "sourceRoot",
3269
+ "stripInternal",
3270
+ /* Interop Constraints */
3271
+ "allowSyntheticDefaultImports",
3272
+ "esModuleInterop",
3273
+ "forceConsistentCasingInFileNames",
3274
+ "isolatedDeclarations",
3275
+ "isolatedModules",
3276
+ "preserveSymlinks",
3277
+ "verbatimModuleSyntax",
3278
+ /* Completeness */
3279
+ "skipDefaultLibCheck",
3280
+ "skipLibCheck"
3281
+ ],
3282
+ pathPattern: "^compilerOptions$"
3283
+ }
3284
+ ]
3285
+ }
3286
+ },
3287
+ {
3288
+ files: [GLOB_JSON, GLOB_JSONC, GLOB_JSON5],
3289
+ name: "kp/json/rules-overrides",
3290
+ rules: {
3291
+ ...overrides
3292
+ }
3293
+ }
3294
+ ];
3295
+ }
3296
+
3297
+ // src/configs/shared-jsx-tsx.ts
3298
+ import { default as pluginJsxA11y } from "eslint-plugin-jsx-a11y";
3299
+ var sharedJsxTsxConfig = {
3300
+ // TODO inherit from ...sharedScriptConfig?
3301
+ plugins: {
3302
+ ...sharedScriptConfig.plugins,
3303
+ "jsx-a11y": pluginJsxA11y
3304
+ },
3305
+ rules: {
3306
+ ...sharedScriptConfig.rules,
3307
+ ...jsxA11yRecommendedRules,
3308
+ ...xoTsxRules
3309
+ }
3310
+ };
3311
+
3312
+ // src/configs/jsx.ts
3313
+ async function jsx(options = {}) {
3314
+ const {
3315
+ overrides = {},
3316
+ typeAware = {
3317
+ enabled: true,
3318
+ ignores: []
3319
+ }
3320
+ } = options;
3321
+ return [
3322
+ {
3323
+ ...sharedJsxTsxConfig,
3324
+ files: [GLOB_JSX],
3325
+ languageOptions: getLanguageOptions(typeAware.enabled, true),
3326
+ name: "kp/jsx/rules",
3327
+ rules: {
3328
+ ...sharedJsxTsxConfig.rules,
3329
+ ...typeAware.enabled ? {} : sharedScriptDisableTypeCheckedRules,
3330
+ ...overrides
3331
+ }
3332
+ },
3333
+ typeAware.enabled && typeAware.ignores.length > 0 ? {
3334
+ files: typeAware.ignores,
3335
+ languageOptions: getLanguageOptions(false, true),
3336
+ name: "kp/jsx/disable-type-aware",
3337
+ rules: {
3338
+ ...sharedScriptDisableTypeCheckedRules
3339
+ }
3340
+ } : {}
3341
+ ];
3342
+ }
3343
+
3344
+ // src/configs/md.ts
3345
+ import * as parserMdx from "eslint-mdx";
3346
+ import * as pluginMdx from "eslint-plugin-mdx";
3347
+ async function md(options = {}) {
3348
+ const { overrides = {}, overridesEmbeddedScripts = {} } = options;
3349
+ const files = [GLOB_MARKDOWN];
3350
+ return [
3351
+ {
3352
+ files,
3353
+ // Need to ignore both Markdown and MDX files to successfully ignore
3354
+ // nested Markdown / MDX blocks
3355
+ ignores: [
3356
+ `${GLOB_MARKDOWN}/*.md`,
3357
+ `${GLOB_MARKDOWN}/*.mdx`,
3358
+ `${GLOB_MDX}/*.md`,
3359
+ `${GLOB_MDX}/*.mdx`
3360
+ ],
3361
+ languageOptions: {
3362
+ ecmaVersion: "latest",
3363
+ globals: {
3364
+ // eslint-disable-next-line ts/naming-convention
3365
+ React: false
3366
+ },
3367
+ parser: parserMdx,
3368
+ sourceType: "module"
3369
+ },
3370
+ name: "kp/markdown/remark",
3371
+ plugins: {
3372
+ ...sharedScriptConfig.plugins,
3373
+ mdx: pluginMdx
3374
+ },
3375
+ // ignores: [GLOB_MARKDOWN_IN_MARKDOWN, GLOB_MARKDOWN_IN_MDX],
3376
+ processor: pluginMdx.createRemarkProcessor({
3377
+ // Lints code in the next pass
3378
+ lintCodeBlocks: true
3379
+ }),
3380
+ // These apply to the remark-lint pass only!
3381
+ rules: {
3382
+ // TODO there's some issue accessing the recommended config:
3383
+ // "Error: Could not find ESLint Linter in require cache"
3384
+ "mdx/remark": "warn",
3385
+ "react/react-in-jsx-scope": 0,
3386
+ "unicorn/filename-case": "error",
3387
+ // No shouting
3388
+ ...overrides
3389
+ }
3390
+ },
3391
+ {
3392
+ // Includes plugins...
3393
+ ...sharedScriptConfig,
3394
+ files: [GLOB_MARKDOWN_CODE],
3395
+ languageOptions: {
3396
+ parserOptions: {
3397
+ projectService: false
3398
+ }
3399
+ },
3400
+ name: "kp/markdown/code-blocks",
3401
+ rules: {
3402
+ ...sharedScriptDisableTypeCheckedRules,
3403
+ "no-unused-expressions": "off",
3404
+ "no-unused-vars": "off",
3405
+ "ts/no-unused-expressions": "off",
3406
+ "ts/no-unused-vars": "off",
3407
+ "unicorn/filename-case": "off",
3408
+ // Don't enforce on internal code block file names
3409
+ // TODO revisit
3410
+ // 'import/newline-after-import': 'off',
3411
+ // 'no-alert': 'off',
3412
+ // 'no-console': 'off',
3413
+ // 'no-labels': 'off',
3414
+ // 'no-lone-blocks': 'off',
3415
+ // 'no-restricted-syntax': 'off',
3416
+ // 'no-undef': 'off',
3417
+ // 'no-unused-labels': 'off',
3418
+ // 'node/prefer-global/process': 'off',
3419
+ // 'style/comma-dangle': 'off',
3420
+ // 'style/eol-last': 'off',
3421
+ // 'ts/consistent-type-imports': 'off',
3422
+ // 'ts/explicit-function-return-type': 'off',
3423
+ // 'ts/no-namespace': 'off',
3424
+ // 'ts/no-redeclare': 'off',
3425
+ // 'ts/no-require-imports': 'off',
3426
+ // 'ts/no-unused-expressions': 'off',
3427
+ // 'ts/no-use-before-define': 'off',
3428
+ // 'unicode-bom': 'off',
3429
+ ...overridesEmbeddedScripts
3430
+ }
3431
+ }
3432
+ ];
3433
+ }
3434
+
3435
+ // src/configs/mdx.ts
3436
+ import * as parserMdx2 from "eslint-mdx";
3437
+ import * as pluginMdx2 from "eslint-plugin-mdx";
3438
+ async function mdx(options = {}) {
3439
+ const { overrides = {}, overridesEmbeddedScripts = {} } = options;
3440
+ const files = [GLOB_MDX];
3441
+ return [
3442
+ {
3443
+ files,
3444
+ // Need to ignore both Markdown and MDX files to successfully ignore
3445
+ // nested Markdown / MDX blocks
3446
+ ignores: [
3447
+ `${GLOB_MARKDOWN}/*.md`,
3448
+ `${GLOB_MARKDOWN}/*.mdx`,
3449
+ `${GLOB_MDX}/*.md`,
3450
+ `${GLOB_MDX}/*.mdx`
3451
+ ],
3452
+ languageOptions: {
3453
+ ecmaVersion: "latest",
3454
+ globals: {
3455
+ // eslint-disable-next-line ts/naming-convention
3456
+ React: false
3457
+ },
3458
+ parser: parserMdx2,
3459
+ sourceType: "module"
3460
+ },
3461
+ name: "kp/mdx/remark",
3462
+ plugins: {
3463
+ ...sharedScriptConfig.plugins,
3464
+ mdx: pluginMdx2
3465
+ },
3466
+ processor: pluginMdx2.createRemarkProcessor({
3467
+ // Lints code in the next pass
3468
+ lintCodeBlocks: true
3469
+ }),
3470
+ // These apply to the remark-lint pass only!
3471
+ rules: {
3472
+ // TODO there's some issue accessing the recommended config:
3473
+ // "Error: Could not find ESLint Linter in require cache"
3474
+ "mdx/remark": "warn",
3475
+ "react/react-in-jsx-scope": 0,
3476
+ // MDX files can be PascalCase OR kebab-case, depending on whether
3477
+ // the file's core nature is that of content or component
3478
+ "unicorn/filename-case": [
3479
+ "error",
3480
+ {
3481
+ cases: {
3482
+ kebabCase: true,
3483
+ pascalCase: true
3484
+ }
3485
+ }
3486
+ ],
3487
+ ...overrides
3488
+ }
3489
+ },
3490
+ {
3491
+ files: [GLOB_MDX_CODE],
3492
+ name: "kp/mdx/code-blocks",
3493
+ rules: {
3494
+ // Disable type-checked?
3495
+ "no-unused-expressions": "off",
3496
+ "no-unused-vars": "off",
3497
+ "ts/no-unused-expressions": "off",
3498
+ "ts/no-unused-vars": "off",
3499
+ "unicorn/filename-case": "off",
3500
+ // Don't enforce on internal code block file names
3501
+ // TODO revisit
3502
+ // 'antfu/no-top-level-await': 'off',
3503
+ // 'import/newline-after-import': 'off',
3504
+ // 'no-alert': 'off',
3505
+ // 'no-console': 'off',
3506
+ // 'no-labels': 'off',
3507
+ // 'no-lone-blocks': 'off',
3508
+ // 'no-restricted-syntax': 'off',
3509
+ // 'no-undef': 'off',
3510
+ // 'no-unused-expressions': 'off',
3511
+ // 'no-unused-labels': 'off',
3512
+ // 'no-unused-vars': 'off',
3513
+ // 'node/prefer-global/process': 'off',
3514
+ // 'style/comma-dangle': 'off',
3515
+ // 'style/eol-last': 'off',
3516
+ // 'ts/consistent-type-imports': 'off',
3517
+ // 'ts/explicit-function-return-type': 'off',
3518
+ // 'ts/no-namespace': 'off',
3519
+ // 'ts/no-redeclare': 'off',
3520
+ // 'ts/no-require-imports': 'off',
3521
+ // 'ts/no-unused-expressions': 'off',
3522
+ // 'ts/no-unused-vars': 'off',
3523
+ // MDX files can be PascalCase OR kebab-case, depending on whether
3524
+ // the file's core nature is that of content or component
3525
+ // 'unicorn/filename-case': 'off',
3526
+ // 'ts/no-use-before-define': 'off',
3527
+ // 'unicode-bom': 'off',
3528
+ ...overridesEmbeddedScripts
3529
+ }
3530
+ }
3531
+ ];
3532
+ }
3533
+
3534
+ // src/configs/react.ts
3535
+ async function react(options = {}) {
3536
+ const {
3537
+ overrides = {},
3538
+ typeAware = {
3539
+ enabled: true,
3540
+ ignores: []
3541
+ }
3542
+ } = options;
3543
+ const files = [GLOB_SRC, `${GLOB_MARKDOWN}/**`, `${GLOB_MDX}/**`, GLOB_ASTRO_TS];
3544
+ const ignoresTypeAware = [
3545
+ `${GLOB_MARKDOWN}/**`,
3546
+ `${GLOB_MDX}/**`,
3547
+ GLOB_ASTRO_TS,
3548
+ ...typeAware.ignores
3549
+ ];
3550
+ const pluginReact = await interopDefault(import("@eslint-react/eslint-plugin"));
3551
+ const recommendedTypescriptConfig = pluginReact.configs["recommended-typescript"];
3552
+ const { plugins } = recommendedTypescriptConfig;
3553
+ return [
3554
+ {
3555
+ name: "kp/react/setup",
3556
+ plugins: {
3557
+ react: plugins["@eslint-react"],
3558
+ "react-debug": plugins["@eslint-react/debug"],
3559
+ "react-dom": plugins["@eslint-react/dom"],
3560
+ "react-hooks-extra": plugins["@eslint-react/hooks-extra"],
3561
+ "react-naming-convention": plugins["@eslint-react/naming-convention"],
3562
+ "react-web-api": plugins["@eslint-react/web-api"]
3563
+ },
3564
+ settings: recommendedTypescriptConfig.settings
3565
+ },
3566
+ {
3567
+ files,
3568
+ languageOptions: {
3569
+ parserOptions: {
3570
+ ecmaFeatures: {
3571
+ impliedStrict: true,
3572
+ jsx: true
3573
+ }
3574
+ },
3575
+ sourceType: "module"
3576
+ },
3577
+ name: "kp/react/rules",
3578
+ rules: {
3579
+ ...reactRecommendedTypeCheckedRules,
3580
+ ...typeAware.enabled ? {} : reactDisableTypeCheckedRules,
3581
+ ...overrides
3582
+ }
3583
+ },
3584
+ typeAware.enabled ? {
3585
+ files: ignoresTypeAware,
3586
+ languageOptions: {
3587
+ parserOptions: {
3588
+ ecmaFeatures: {
3589
+ impliedStrict: true,
3590
+ jsx: true
3591
+ },
3592
+ projectService: false
3593
+ }
3594
+ },
3595
+ name: "kp/react/disable-type-aware",
3596
+ rules: {
3597
+ ...reactDisableTypeCheckedRules
3598
+ }
3599
+ } : {}
3600
+ ];
3601
+ }
3602
+
3603
+ // src/configs/svelte.ts
3604
+ async function svelte(options = {}) {
3605
+ const { overrides = {} } = options;
3606
+ const files = [GLOB_SVELTE];
3607
+ const [pluginSvelte, parserSvelte] = await Promise.all([
3608
+ interopDefault(import("eslint-plugin-svelte")),
3609
+ interopDefault(import("svelte-eslint-parser"))
3610
+ ]);
3611
+ return [
3612
+ {
3613
+ name: "kp/svelte/setup",
3614
+ plugins: {
3615
+ svelte: pluginSvelte
3616
+ }
3617
+ },
3618
+ {
3619
+ // TODO inherit? Or is this just the markup part?
3620
+ ...sharedScriptConfig,
3621
+ files,
3622
+ languageOptions: {
3623
+ parser: parserSvelte,
3624
+ parserOptions: {
3625
+ extraFileExtensions: [".svelte"],
3626
+ parser: tsParser
3627
+ // TODO js version?
3628
+ }
3629
+ },
3630
+ name: "kp/svelte/rules",
3631
+ processor: pluginSvelte.processors[".svelte"],
3632
+ rules: {
3633
+ ...svelteRecommendedRules,
3634
+ "import/no-mutable-exports": "off",
3635
+ // Allow prop export
3636
+ "no-sequences": "off",
3637
+ // Reactive statements
3638
+ // https://github.com/typescript-eslint/typescript-eslint/blob/1cf9243/docs/getting-started/linting/FAQ.md#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
3639
+ "no-undef-init": "off",
3640
+ // Initialize props to undefined
3641
+ "prefer-const": "off",
3642
+ // Needed for let props
3643
+ // TODO revisit, what's template and what's code?
3644
+ // TOdO import shared?
3645
+ "ts/no-confusing-void-expression": "off",
3646
+ // Reactive statements
3647
+ "ts/no-unused-expressions": "off",
3648
+ // Needed for reactive statements
3649
+ "unicorn/filename-case": [
3650
+ // Svelte components are PascalCase
3651
+ "error",
3652
+ {
3653
+ case: "pascalCase",
3654
+ ignore: [
3655
+ String.raw`^\+`
3656
+ // SvelteKit +page.svelte etc.
3657
+ ]
3658
+ }
3659
+ ],
3660
+ "unicorn/no-useless-undefined": "off",
3661
+ // Needed for let props
3662
+ ...overrides
3663
+ }
3664
+ },
3665
+ {
3666
+ // TODO is this the right spot?
3667
+ files: ["**/routes/**/+*.ts"],
3668
+ rules: {
3669
+ // Error often imported from from '@sveltejs/kit in SvelteKit files
3670
+ "ts/no-throw-literal": "off"
3671
+ }
3672
+ }
3673
+ ];
3674
+ }
3675
+
3676
+ // src/configs/test.ts
3677
+ import { default as pluginTest } from "@vitest/eslint-plugin";
3678
+ import { default as pluginNoOnlyTests } from "eslint-plugin-no-only-tests";
3679
+ import globals3 from "globals";
3680
+ var _pluginTest;
3681
+ async function test(options = {}) {
3682
+ const { isInEditor = false, overrides = {} } = options;
3683
+ _pluginTest ||= {
3684
+ ...pluginTest,
3685
+ // eslint-disable-next-line ts/no-unsafe-assignment
3686
+ rules: {
3687
+ ...pluginTest.rules,
3688
+ // Extend `test/no-only-tests` rule
3689
+ // eslint-disable-next-line ts/no-unsafe-member-access
3690
+ ...pluginNoOnlyTests.rules
3691
+ }
3692
+ };
3693
+ return [
3694
+ {
3695
+ name: "kp/test/setup",
3696
+ plugins: {
3697
+ // eslint-disable-next-line ts/no-unsafe-assignment
3698
+ test: _pluginTest
3699
+ },
3700
+ settings: {
3701
+ vitest: {
3702
+ typecheck: true
3703
+ }
3704
+ }
3705
+ },
3706
+ {
3707
+ files: [GLOB_TESTS],
3708
+ languageOptions: {
3709
+ globals: {
3710
+ // TODO more globals?
3711
+ ...globals3.vitest
3712
+ }
3713
+ },
3714
+ name: "kp/test/rules",
3715
+ rules: {
3716
+ ...testRecommendedRules,
3717
+ ...xoTypescriptTestRules,
3718
+ "test/no-only-tests": isInEditor ? "off" : "error",
3719
+ ...overrides
3720
+ }
3721
+ }
3722
+ ];
3723
+ }
3724
+
3725
+ // src/configs/toml.ts
3726
+ async function toml(options = {}) {
3727
+ const { overrides = {} } = options;
3728
+ const files = [GLOB_TOML];
3729
+ const [pluginToml, parserToml] = await Promise.all([
3730
+ interopDefault(import("eslint-plugin-toml")),
3731
+ interopDefault(import("toml-eslint-parser"))
3732
+ ]);
3733
+ return [
3734
+ {
3735
+ name: "kp/toml/setup",
3736
+ plugins: {
3737
+ toml: pluginToml
3738
+ }
3739
+ },
3740
+ {
3741
+ files,
3742
+ languageOptions: {
3743
+ parser: parserToml
3744
+ },
3745
+ name: "kp/toml/rules",
3746
+ rules: {
3747
+ ...tomlRecommendedRules,
3748
+ ...overrides
3749
+ }
3750
+ }
3751
+ ];
3752
+ }
3753
+
3754
+ // src/configs/ts.ts
3755
+ async function ts(options = {}) {
3756
+ const {
3757
+ overrides = {},
3758
+ typeAware = {
3759
+ enabled: true,
3760
+ ignores: []
3761
+ }
3762
+ } = options;
3763
+ return [
3764
+ {
3765
+ ...sharedScriptConfig,
3766
+ files: [GLOB_TS],
3767
+ languageOptions: getLanguageOptions(typeAware.enabled, false),
3768
+ name: "kp/ts/rules",
3769
+ rules: {
3770
+ ...sharedScriptConfig.rules,
3771
+ ...typeAware.enabled ? {} : sharedScriptDisableTypeCheckedRules,
3772
+ "jsdoc/require-param": "off",
3773
+ "jsdoc/require-returns": "off",
3774
+ ...overrides
3775
+ }
3776
+ },
3777
+ {
3778
+ files: ["**/*.d.?([cm])ts"],
3779
+ name: "kp/ts/dts",
3780
+ rules: {
3781
+ ...xoTypescriptDtsRules
3782
+ }
3783
+ },
3784
+ typeAware.enabled && typeAware.ignores.length > 0 ? {
3785
+ files: typeAware.ignores,
3786
+ languageOptions: getLanguageOptions(false, false),
3787
+ name: "kp/ts/disable-type-aware",
3788
+ rules: {
3789
+ ...sharedScriptDisableTypeCheckedRules
3790
+ }
3791
+ } : {}
3792
+ ];
3793
+ }
3794
+
3795
+ // src/configs/tsx.ts
3796
+ async function tsx(options = {}) {
3797
+ const {
3798
+ overrides = {},
3799
+ typeAware = {
3800
+ enabled: true,
3801
+ ignores: []
3802
+ }
3803
+ } = options;
3804
+ return [
3805
+ {
3806
+ ...sharedJsxTsxConfig,
3807
+ files: [GLOB_TSX],
3808
+ languageOptions: getLanguageOptions(typeAware.enabled, true),
3809
+ name: "kp/tsx/rules",
3810
+ rules: {
3811
+ ...sharedJsxTsxConfig.rules,
3812
+ ...typeAware.enabled ? {} : sharedScriptDisableTypeCheckedRules,
3813
+ ...overrides
3814
+ }
3815
+ },
3816
+ typeAware.enabled && typeAware.ignores.length > 0 ? {
3817
+ files: typeAware.ignores,
3818
+ languageOptions: getLanguageOptions(false, true),
3819
+ name: "kp/tsx/disable-type-aware",
3820
+ rules: {
3821
+ ...sharedScriptDisableTypeCheckedRules
3822
+ }
3823
+ } : {}
3824
+ ];
3825
+ }
3826
+
3827
+ // src/configs/yaml.ts
3828
+ async function yaml(options = {}) {
3829
+ const { overrides = {} } = options;
3830
+ const files = [GLOB_YAML];
3831
+ const [pluginYaml, parserYaml] = await Promise.all([
3832
+ interopDefault(import("eslint-plugin-yml")),
3833
+ interopDefault(import("yaml-eslint-parser"))
3834
+ ]);
3835
+ return [
3836
+ {
3837
+ name: "kp/yaml/setup",
3838
+ plugins: {
3839
+ yaml: pluginYaml
3840
+ }
3841
+ },
3842
+ {
3843
+ files,
3844
+ languageOptions: {
3845
+ parser: parserYaml
3846
+ },
3847
+ name: "kp/yaml/rules",
3848
+ rules: {
3849
+ ...yamlRecommendedRules,
3850
+ ...overrides
3851
+ }
3852
+ }
3853
+ ];
3854
+ }
3855
+ export {
3856
+ GLOB_ALL_SRC,
3857
+ GLOB_ASTRO,
3858
+ GLOB_ASTRO_JS,
3859
+ GLOB_ASTRO_TS,
3860
+ GLOB_CSS,
3861
+ GLOB_EXCLUDE,
3862
+ GLOB_GRAPHQL,
3863
+ GLOB_HTML,
3864
+ GLOB_JS,
3865
+ GLOB_JSON,
3866
+ GLOB_JSON5,
3867
+ GLOB_JSONC,
3868
+ GLOB_JSX,
3869
+ GLOB_LESS,
3870
+ GLOB_MARKDOWN,
3871
+ GLOB_MARKDOWN_CODE,
3872
+ GLOB_MDX,
3873
+ GLOB_MDX_CODE,
3874
+ GLOB_POSTCSS,
3875
+ GLOB_SCSS,
3876
+ GLOB_SRC,
3877
+ GLOB_SRC_EXT,
3878
+ GLOB_STYLE,
3879
+ GLOB_SVELTE,
3880
+ GLOB_SVG,
3881
+ GLOB_TESTS,
3882
+ GLOB_TOML,
3883
+ GLOB_TS,
3884
+ GLOB_TSX,
3885
+ GLOB_XML,
3886
+ GLOB_YAML,
3887
+ astro,
3888
+ combine,
3889
+ eslintConfig as default,
3890
+ defaultPluginRenaming,
3891
+ disables,
3892
+ eslintConfig,
3893
+ generatePerfectionistSortConfig,
3894
+ getLanguageOptions,
3895
+ getOverrides,
3896
+ getOverridesEmbeddedScripts,
3897
+ html,
3898
+ ignores,
3899
+ interopDefault,
3900
+ isInEditorEnv,
3901
+ isInGitHooksOrLintStaged,
3902
+ js,
3903
+ json,
3904
+ jsx,
3905
+ md,
3906
+ mdx,
3907
+ react,
3908
+ renamePluginInConfigs,
3909
+ renameRules,
3910
+ resolveSubOptions,
3911
+ svelte,
3912
+ test,
3913
+ toArray,
3914
+ toml,
3915
+ ts,
3916
+ tsx,
3917
+ yaml
3918
+ };