@debbl/eslint-config 2.4.0 → 3.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.cjs CHANGED
@@ -1,1672 +1 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/index.ts
31
- var src_exports = {};
32
- __export(src_exports, {
33
- GLOB_ALL_SRC: () => GLOB_ALL_SRC,
34
- GLOB_CSS: () => GLOB_CSS,
35
- GLOB_EXCLUDE: () => GLOB_EXCLUDE,
36
- GLOB_HTML: () => GLOB_HTML,
37
- GLOB_JS: () => GLOB_JS,
38
- GLOB_JSON: () => GLOB_JSON,
39
- GLOB_JSON5: () => GLOB_JSON5,
40
- GLOB_JSONC: () => GLOB_JSONC,
41
- GLOB_JSX: () => GLOB_JSX,
42
- GLOB_LESS: () => GLOB_LESS,
43
- GLOB_MARKDOWN: () => GLOB_MARKDOWN,
44
- GLOB_MARKDOWN_CODE: () => GLOB_MARKDOWN_CODE,
45
- GLOB_MDX: () => GLOB_MDX,
46
- GLOB_POSTCSS: () => GLOB_POSTCSS,
47
- GLOB_SCSS: () => GLOB_SCSS,
48
- GLOB_SRC: () => GLOB_SRC,
49
- GLOB_SRC_EXT: () => GLOB_SRC_EXT,
50
- GLOB_STYLE: () => GLOB_STYLE,
51
- GLOB_TESTS: () => GLOB_TESTS,
52
- GLOB_TOML: () => GLOB_TOML,
53
- GLOB_TS: () => GLOB_TS,
54
- GLOB_TSX: () => GLOB_TSX,
55
- GLOB_VUE: () => GLOB_VUE,
56
- GLOB_YAML: () => GLOB_YAML,
57
- combine: () => combine,
58
- comments: () => comments,
59
- config: () => config,
60
- default: () => src_default,
61
- ignores: () => ignores,
62
- imports: () => imports,
63
- interopDefault: () => interopDefault,
64
- javascript: () => javascript,
65
- jsdoc: () => jsdoc,
66
- jsonc: () => jsonc,
67
- markdown: () => markdown,
68
- node: () => node,
69
- perfectionist: () => perfectionist,
70
- prettier: () => prettier,
71
- sortPackageJson: () => sortPackageJson,
72
- sortTsconfig: () => sortTsconfig,
73
- test: () => test,
74
- toml: () => toml,
75
- typescript: () => typescript,
76
- unicorn: () => unicorn,
77
- vue: () => vue,
78
- yml: () => yml
79
- });
80
- module.exports = __toCommonJS(src_exports);
81
-
82
- // src/configs/comments.ts
83
- async function comments() {
84
- const pluginComments = await interopDefault(
85
- // @ts-expect-error missing types
86
- import("eslint-plugin-eslint-comments")
87
- );
88
- return [
89
- {
90
- name: "eslint:eslint-comments",
91
- plugins: {
92
- "eslint-comments": pluginComments
93
- },
94
- rules: {
95
- "eslint-comments/no-aggregating-enable": "error",
96
- "eslint-comments/no-duplicate-disable": "error",
97
- "eslint-comments/no-unlimited-disable": "error",
98
- "eslint-comments/no-unused-enable": "error"
99
- }
100
- }
101
- ];
102
- }
103
-
104
- // src/configs/ignores.ts
105
- var import_node_fs = __toESM(require("fs"), 1);
106
- var import_node_path = __toESM(require("path"), 1);
107
-
108
- // src/globs.ts
109
- var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
110
- var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
111
- var GLOB_JS = "**/*.?([cm])js";
112
- var GLOB_JSX = "**/*.?([cm])jsx";
113
- var GLOB_TS = "**/*.?([cm])ts";
114
- var GLOB_TSX = "**/*.?([cm])tsx";
115
- var GLOB_STYLE = "**/*.{c,le,sc}ss";
116
- var GLOB_CSS = "**/*.css";
117
- var GLOB_POSTCSS = "**/*.{p,post}css";
118
- var GLOB_LESS = "**/*.less";
119
- var GLOB_SCSS = "**/*.scss";
120
- var GLOB_JSON = "**/*.json";
121
- var GLOB_JSON5 = "**/*.json5";
122
- var GLOB_JSONC = "**/*.jsonc";
123
- var GLOB_MARKDOWN = "**/*.md";
124
- var GLOB_MDX = "**/*.mdx";
125
- var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
126
- var GLOB_VUE = "**/*.vue";
127
- var GLOB_YAML = "**/*.y?(a)ml";
128
- var GLOB_TOML = "**/*.toml";
129
- var GLOB_HTML = "**/*.htm?(l)";
130
- var GLOB_TESTS = [
131
- `**/__tests__/**/*.${GLOB_SRC_EXT}`,
132
- `**/*.spec.${GLOB_SRC_EXT}`,
133
- `**/*.test.${GLOB_SRC_EXT}`,
134
- `**/*.bench.${GLOB_SRC_EXT}`,
135
- `**/*.benchmark.${GLOB_SRC_EXT}`
136
- ];
137
- var GLOB_ALL_SRC = [
138
- GLOB_SRC,
139
- GLOB_STYLE,
140
- GLOB_JSON,
141
- GLOB_JSON5,
142
- GLOB_MARKDOWN,
143
- GLOB_VUE,
144
- GLOB_YAML,
145
- GLOB_HTML
146
- ];
147
- var GLOB_EXCLUDE = [
148
- "**/node_modules",
149
- "**/dist",
150
- "**/package-lock.json",
151
- "**/yarn.lock",
152
- "**/pnpm-lock.yaml",
153
- "**/bun.lockb",
154
- "**/output",
155
- "**/coverage",
156
- "**/temp",
157
- "**/.vitepress/cache",
158
- "**/.nuxt",
159
- "**/.next",
160
- "**/.vercel",
161
- "**/.changeset",
162
- "**/.idea",
163
- "**/.cache",
164
- "**/.output",
165
- "**/.vite-inspect",
166
- "**/CHANGELOG*.md",
167
- "**/*.min.*",
168
- "**/LICENSE*",
169
- "**/__snapshots__",
170
- "**/auto-import?(s).d.ts",
171
- "**/components.d.ts"
172
- ];
173
-
174
- // src/configs/ignores.ts
175
- var REGEX_SPLIT_ALL_CRLF = /\r?\n/g;
176
- var splitPattern = (pattern) => pattern.split(REGEX_SPLIT_ALL_CRLF);
177
- async function ignores(options) {
178
- const { enableGitignore } = options;
179
- if (enableGitignore) {
180
- let ignorePath = ".gitignore";
181
- if (typeof enableGitignore !== "boolean") {
182
- ignorePath = enableGitignore.ignorePath;
183
- }
184
- const gitignorePath = import_node_path.default.join(process.cwd(), ignorePath);
185
- let ignoreList = [];
186
- if (import_node_fs.default.existsSync(gitignorePath)) {
187
- ignoreList = splitPattern(import_node_fs.default.readFileSync(gitignorePath).toString()).filter((i) => !(i.startsWith("#") || i.length === 0)).map((i) => i.startsWith("/") ? i.slice(1) : i);
188
- return [
189
- {
190
- ignores: [...ignoreList, ...GLOB_EXCLUDE]
191
- }
192
- ];
193
- }
194
- }
195
- return [
196
- {
197
- ignores: GLOB_EXCLUDE
198
- }
199
- ];
200
- }
201
-
202
- // src/utils.ts
203
- async function combine(...configs) {
204
- const resolved = await Promise.all(configs);
205
- return resolved.flat();
206
- }
207
- async function interopDefault(m) {
208
- const resolved = await m;
209
- return resolved.default || resolved;
210
- }
211
-
212
- // src/configs/imports.ts
213
- async function imports() {
214
- const pluginImport = await interopDefault(import("eslint-plugin-i"));
215
- return [
216
- {
217
- name: "eslint:imports",
218
- plugins: {
219
- import: pluginImport
220
- },
221
- rules: {
222
- "import/first": "error",
223
- "import/no-duplicates": "error",
224
- "import/no-mutable-exports": "error",
225
- "import/no-named-default": "error",
226
- "import/no-self-import": "error",
227
- "import/no-webpack-loader-syntax": "error",
228
- "import/order": "error",
229
- "import/newline-after-import": [
230
- "error",
231
- { considerComments: true, count: 1 }
232
- ]
233
- }
234
- }
235
- ];
236
- }
237
-
238
- // src/configs/javascript.ts
239
- var import_globals = __toESM(require("globals"), 1);
240
- async function javascript() {
241
- const pluginUnusedImports = await interopDefault(
242
- // @ts-expect-error missing types
243
- import("eslint-plugin-unused-imports")
244
- );
245
- return [
246
- {
247
- name: "eslint:javascript",
248
- languageOptions: {
249
- ecmaVersion: 2022,
250
- globals: {
251
- ...import_globals.default.browser,
252
- ...import_globals.default.es2021,
253
- ...import_globals.default.node,
254
- document: "readonly",
255
- navigator: "readonly",
256
- window: "readonly"
257
- },
258
- parserOptions: {
259
- ecmaFeatures: {
260
- jsx: true
261
- },
262
- ecmaVersion: 2022,
263
- sourceType: "module"
264
- },
265
- sourceType: "module"
266
- },
267
- linterOptions: {
268
- reportUnusedDisableDirectives: true
269
- },
270
- plugins: {
271
- "unused-imports": pluginUnusedImports
272
- },
273
- rules: {
274
- "accessor-pairs": [
275
- "error",
276
- { enforceForClassMembers: true, setWithoutGet: true }
277
- ],
278
- "array-callback-return": "error",
279
- "block-scoped-var": "error",
280
- "constructor-super": "error",
281
- "default-case-last": "error",
282
- "dot-notation": ["error", { allowKeywords: true }],
283
- "eqeqeq": ["error", "smart"],
284
- "new-cap": [
285
- "error",
286
- { capIsNew: false, newIsCap: true, properties: true }
287
- ],
288
- "no-alert": "error",
289
- "no-array-constructor": "error",
290
- "no-async-promise-executor": "error",
291
- "no-caller": "error",
292
- "no-case-declarations": "error",
293
- "no-class-assign": "error",
294
- "no-compare-neg-zero": "error",
295
- "no-cond-assign": ["error", "always"],
296
- "no-console": ["error", { allow: ["warn", "error"] }],
297
- "no-const-assign": "error",
298
- "no-control-regex": "error",
299
- "no-debugger": "error",
300
- "no-delete-var": "error",
301
- "no-dupe-args": "error",
302
- "no-dupe-class-members": "error",
303
- "no-dupe-keys": "error",
304
- "no-duplicate-case": "error",
305
- "no-empty": ["error", { allowEmptyCatch: true }],
306
- "no-empty-character-class": "error",
307
- "no-empty-pattern": "error",
308
- "no-eval": "error",
309
- "no-ex-assign": "error",
310
- "no-extend-native": "error",
311
- "no-extra-bind": "error",
312
- "no-extra-boolean-cast": "error",
313
- "no-fallthrough": "error",
314
- "no-func-assign": "error",
315
- "no-global-assign": "error",
316
- "no-implied-eval": "error",
317
- "no-import-assign": "error",
318
- "no-invalid-regexp": "error",
319
- "no-invalid-this": "error",
320
- "no-irregular-whitespace": "error",
321
- "no-iterator": "error",
322
- "no-labels": ["error", { allowLoop: false, allowSwitch: false }],
323
- "no-lone-blocks": "error",
324
- "no-loss-of-precision": "error",
325
- "no-misleading-character-class": "error",
326
- "no-multi-str": "error",
327
- "no-new": "error",
328
- "no-new-func": "error",
329
- "no-new-object": "error",
330
- "no-new-symbol": "error",
331
- "no-new-wrappers": "error",
332
- "no-obj-calls": "error",
333
- "no-octal": "error",
334
- "no-octal-escape": "error",
335
- "no-proto": "error",
336
- "no-prototype-builtins": "error",
337
- "no-redeclare": ["error", { builtinGlobals: false }],
338
- "no-regex-spaces": "error",
339
- "no-restricted-globals": [
340
- "error",
341
- { message: "Use `globalThis` instead.", name: "global" },
342
- { message: "Use `globalThis` instead.", name: "self" }
343
- ],
344
- "no-restricted-properties": [
345
- "error",
346
- {
347
- message: "Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.",
348
- property: "__proto__"
349
- },
350
- {
351
- message: "Use `Object.defineProperty` instead.",
352
- property: "__defineGetter__"
353
- },
354
- {
355
- message: "Use `Object.defineProperty` instead.",
356
- property: "__defineSetter__"
357
- },
358
- {
359
- message: "Use `Object.getOwnPropertyDescriptor` instead.",
360
- property: "__lookupGetter__"
361
- },
362
- {
363
- message: "Use `Object.getOwnPropertyDescriptor` instead.",
364
- property: "__lookupSetter__"
365
- }
366
- ],
367
- "no-restricted-syntax": [
368
- "error",
369
- "DebuggerStatement",
370
- "LabeledStatement",
371
- "WithStatement",
372
- "TSEnumDeclaration[const=true]",
373
- "TSExportAssignment"
374
- ],
375
- "no-self-assign": ["error", { props: true }],
376
- "no-self-compare": "error",
377
- "no-sequences": "error",
378
- "no-shadow-restricted-names": "error",
379
- "no-sparse-arrays": "error",
380
- "no-template-curly-in-string": "error",
381
- "no-this-before-super": "error",
382
- "no-throw-literal": "error",
383
- "no-undef": "error",
384
- "no-undef-init": "error",
385
- "no-unexpected-multiline": "error",
386
- "no-unmodified-loop-condition": "error",
387
- "no-unneeded-ternary": ["error", { defaultAssignment: false }],
388
- "no-unreachable": "error",
389
- "no-unreachable-loop": "error",
390
- "no-unsafe-finally": "error",
391
- "no-unsafe-negation": "error",
392
- "no-unused-expressions": [
393
- "error",
394
- {
395
- allowShortCircuit: true,
396
- allowTaggedTemplates: true,
397
- allowTernary: true
398
- }
399
- ],
400
- "no-unused-vars": [
401
- "error",
402
- {
403
- args: "none",
404
- caughtErrors: "none",
405
- ignoreRestSiblings: true,
406
- vars: "all"
407
- }
408
- ],
409
- "no-use-before-define": [
410
- "error",
411
- { classes: false, functions: false, variables: true }
412
- ],
413
- "no-useless-backreference": "error",
414
- "no-useless-call": "error",
415
- "no-useless-catch": "error",
416
- "no-useless-computed-key": "error",
417
- "no-useless-constructor": "error",
418
- "no-useless-rename": "error",
419
- "no-useless-return": "error",
420
- "no-var": "error",
421
- "no-with": "error",
422
- "object-shorthand": [
423
- "error",
424
- "always",
425
- {
426
- avoidQuotes: true,
427
- ignoreConstructors: false
428
- }
429
- ],
430
- "one-var": ["error", { initialized: "never" }],
431
- "prefer-arrow-callback": [
432
- "error",
433
- {
434
- allowNamedFunctions: false,
435
- allowUnboundThis: true
436
- }
437
- ],
438
- "prefer-const": [
439
- "error",
440
- {
441
- destructuring: "all",
442
- ignoreReadBeforeAssign: true
443
- }
444
- ],
445
- "prefer-exponentiation-operator": "error",
446
- "prefer-promise-reject-errors": "error",
447
- "prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
448
- "prefer-rest-params": "error",
449
- "prefer-spread": "error",
450
- "prefer-template": "error",
451
- "sort-imports": [
452
- "error",
453
- {
454
- allowSeparatedGroups: false,
455
- ignoreCase: false,
456
- ignoreDeclarationSort: true,
457
- ignoreMemberSort: false,
458
- memberSyntaxSortOrder: ["none", "all", "multiple", "single"]
459
- }
460
- ],
461
- "symbol-description": "error",
462
- "unicode-bom": ["error", "never"],
463
- "unused-imports/no-unused-imports": "warn",
464
- "unused-imports/no-unused-vars": [
465
- "error",
466
- {
467
- args: "after-used",
468
- argsIgnorePattern: "^_",
469
- vars: "all",
470
- varsIgnorePattern: "^_"
471
- }
472
- ],
473
- "use-isnan": [
474
- "error",
475
- { enforceForIndexOf: true, enforceForSwitchCase: true }
476
- ],
477
- "valid-typeof": ["error", { requireStringLiterals: true }],
478
- "vars-on-top": "error",
479
- "yoda": ["error", "never"]
480
- }
481
- },
482
- {
483
- name: "eslint:scripts-overrides",
484
- files: [`scripts/${GLOB_SRC}`, `cli.${GLOB_SRC_EXT}`],
485
- rules: {
486
- "no-console": "off"
487
- }
488
- }
489
- ];
490
- }
491
-
492
- // src/configs/jsdoc.ts
493
- async function jsdoc() {
494
- return [
495
- {
496
- name: "eslint:jsdoc",
497
- plugins: {
498
- // @ts-expect-error missing types
499
- jsdoc: await interopDefault(import("eslint-plugin-jsdoc"))
500
- },
501
- rules: {
502
- "jsdoc/check-access": "warn",
503
- "jsdoc/check-param-names": "warn",
504
- "jsdoc/check-property-names": "warn",
505
- "jsdoc/check-types": "warn",
506
- "jsdoc/empty-tags": "warn",
507
- "jsdoc/implements-on-classes": "warn",
508
- "jsdoc/no-defaults": "warn",
509
- "jsdoc/no-multi-asterisks": "warn",
510
- "jsdoc/require-param-name": "warn",
511
- "jsdoc/require-property": "warn",
512
- "jsdoc/require-property-description": "warn",
513
- "jsdoc/require-property-name": "warn",
514
- "jsdoc/require-returns-check": "warn",
515
- "jsdoc/require-returns-description": "warn",
516
- "jsdoc/require-yields-check": "warn",
517
- "jsdoc/check-alignment": "warn",
518
- "jsdoc/multiline-blocks": "warn"
519
- }
520
- }
521
- ];
522
- }
523
-
524
- // src/configs/jsonc.ts
525
- async function jsonc() {
526
- const [pluginJsonc, parserJsonc] = await Promise.all([
527
- interopDefault(import("eslint-plugin-jsonc")),
528
- interopDefault(import("jsonc-eslint-parser"))
529
- ]);
530
- return [
531
- {
532
- name: "eslint:jsonc:setup",
533
- plugins: {
534
- jsonc: pluginJsonc
535
- }
536
- },
537
- {
538
- name: "eslint:jsonc:rules",
539
- files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
540
- languageOptions: {
541
- parser: parserJsonc
542
- },
543
- rules: {
544
- "jsonc/no-bigint-literals": "error",
545
- "jsonc/no-binary-expression": "error",
546
- "jsonc/no-binary-numeric-literals": "error",
547
- "jsonc/no-dupe-keys": "error",
548
- "jsonc/no-escape-sequence-in-identifier": "error",
549
- "jsonc/no-floating-decimal": "error",
550
- "jsonc/no-hexadecimal-numeric-literals": "error",
551
- "jsonc/no-infinity": "error",
552
- "jsonc/no-multi-str": "error",
553
- "jsonc/no-nan": "error",
554
- "jsonc/no-number-props": "error",
555
- "jsonc/no-numeric-separators": "error",
556
- "jsonc/no-octal": "error",
557
- "jsonc/no-octal-escape": "error",
558
- "jsonc/no-octal-numeric-literals": "error",
559
- "jsonc/no-parenthesized": "error",
560
- "jsonc/no-plus-sign": "error",
561
- "jsonc/no-regexp-literals": "error",
562
- "jsonc/no-sparse-arrays": "error",
563
- "jsonc/no-template-literals": "error",
564
- "jsonc/no-undefined-value": "error",
565
- "jsonc/no-unicode-codepoint-escapes": "error",
566
- "jsonc/no-useless-escape": "error",
567
- "jsonc/space-unary-ops": "error",
568
- "jsonc/valid-json-number": "error",
569
- "jsonc/vue-custom-block/no-parsing-error": "error",
570
- "jsonc/array-bracket-spacing": ["error", "never"],
571
- "jsonc/comma-dangle": ["error", "never"],
572
- "jsonc/comma-style": ["error", "last"],
573
- "jsonc/indent": ["error", 2],
574
- "jsonc/key-spacing": [
575
- "error",
576
- { afterColon: true, beforeColon: false }
577
- ],
578
- "jsonc/object-curly-newline": [
579
- "error",
580
- { consistent: true, multiline: true }
581
- ],
582
- "jsonc/object-curly-spacing": ["error", "always"],
583
- "jsonc/object-property-newline": [
584
- "error",
585
- { allowMultiplePropertiesPerLine: true }
586
- ],
587
- "jsonc/quote-props": "error",
588
- "jsonc/quotes": "error"
589
- }
590
- }
591
- ];
592
- }
593
-
594
- // src/configs/markdown.ts
595
- async function markdown(options = {}) {
596
- const { componentExts = [] } = options;
597
- const [pluginMdx, parserMdx] = await Promise.all([
598
- interopDefault(import("eslint-plugin-mdx")),
599
- interopDefault(import("eslint-mdx"))
600
- ]);
601
- return [
602
- {
603
- name: "eslint:markdown:setup",
604
- plugins: {
605
- mdx: pluginMdx
606
- }
607
- },
608
- {
609
- name: "eslint:markdown:processor",
610
- files: [GLOB_MARKDOWN, GLOB_MDX],
611
- languageOptions: {
612
- ecmaVersion: "latest",
613
- parser: parserMdx,
614
- sourceType: "module"
615
- },
616
- processor: "mdx/remark",
617
- settings: {
618
- "mdx/code-blocks": true
619
- }
620
- },
621
- {
622
- name: "eslint:markdown:rules",
623
- files: [
624
- GLOB_MARKDOWN_CODE,
625
- ...componentExts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)
626
- ],
627
- languageOptions: {
628
- parserOptions: {
629
- ecmaFeatures: {
630
- impliedStrict: true
631
- }
632
- }
633
- },
634
- rules: {
635
- "no-alert": "off",
636
- "no-console": "off",
637
- "no-undef": "off",
638
- "no-unused-expressions": "off",
639
- "no-unused-vars": "off",
640
- "node/prefer-global/process": "off",
641
- "style/comma-dangle": "off",
642
- "style/eol-last": "off",
643
- "@typescript-eslint/consistent-type-imports": "off",
644
- "@typescript-eslint/no-namespace": "off",
645
- "@typescript-eslint/no-redeclare": "off",
646
- "@typescript-eslint/no-require-imports": "off",
647
- "@typescript-eslint/no-unused-vars": "off",
648
- "@typescript-eslint/no-use-before-define": "off",
649
- "@typescript-eslint/no-var-requires": "off",
650
- "unicode-bom": "off",
651
- "unused-imports/no-unused-imports": "off",
652
- "unused-imports/no-unused-vars": "off",
653
- // Type aware rules
654
- ...{
655
- "@typescript-eslint/await-thenable": "off",
656
- "@typescript-eslint/dot-notation": "off",
657
- "@typescript-eslint/no-floating-promises": "off",
658
- "@typescript-eslint/no-for-in-array": "off",
659
- "@typescript-eslint/no-implied-eval": "off",
660
- "@typescript-eslint/no-misused-promises": "off",
661
- "@typescript-eslint/no-throw-literal": "off",
662
- "@typescript-eslint/no-unnecessary-type-assertion": "off",
663
- "@typescript-eslint/no-unsafe-argument": "off",
664
- "@typescript-eslint/no-unsafe-assignment": "off",
665
- "@typescript-eslint/no-unsafe-call": "off",
666
- "@typescript-eslint/no-unsafe-member-access": "off",
667
- "@typescript-eslint/no-unsafe-return": "off",
668
- "@typescript-eslint/restrict-plus-operands": "off",
669
- "@typescript-eslint/restrict-template-expressions": "off",
670
- "@typescript-eslint/unbound-method": "off"
671
- }
672
- }
673
- }
674
- ];
675
- }
676
-
677
- // src/configs/node.ts
678
- async function node() {
679
- const pluginNode = await interopDefault(import("eslint-plugin-n"));
680
- return [
681
- {
682
- name: "eslint:node",
683
- plugins: {
684
- n: pluginNode
685
- },
686
- rules: {
687
- "n/handle-callback-err": ["error", "^(err|error)$"],
688
- "n/no-deprecated-api": "error",
689
- "n/no-exports-assign": "error",
690
- "n/no-new-require": "error",
691
- "n/no-path-concat": "error",
692
- "n/prefer-global/buffer": ["error", "never"],
693
- "n/prefer-global/process": ["error", "never"],
694
- "n/process-exit-as-throw": "error"
695
- }
696
- }
697
- ];
698
- }
699
-
700
- // src/configs/sort.ts
701
- async function sortPackageJson() {
702
- return [
703
- {
704
- name: "eslint:sort-package-json",
705
- files: ["**/package.json"],
706
- rules: {
707
- "jsonc/sort-array-values": [
708
- "error",
709
- {
710
- order: { type: "asc" },
711
- pathPattern: "^files$"
712
- }
713
- ],
714
- "jsonc/sort-keys": [
715
- "error",
716
- {
717
- order: [
718
- "publisher",
719
- "name",
720
- "displayName",
721
- "type",
722
- "version",
723
- "private",
724
- "packageManager",
725
- "description",
726
- "author",
727
- "license",
728
- "funding",
729
- "homepage",
730
- "repository",
731
- "bugs",
732
- "keywords",
733
- "categories",
734
- "sideEffects",
735
- "exports",
736
- "main",
737
- "module",
738
- "unpkg",
739
- "jsdelivr",
740
- "types",
741
- "typesVersions",
742
- "bin",
743
- "icon",
744
- "files",
745
- "engines",
746
- "activationEvents",
747
- "contributes",
748
- "scripts",
749
- "peerDependencies",
750
- "peerDependenciesMeta",
751
- "dependencies",
752
- "optionalDependencies",
753
- "devDependencies",
754
- "pnpm",
755
- "overrides",
756
- "resolutions",
757
- "husky",
758
- "simple-git-hooks",
759
- "lint-staged",
760
- "eslintConfig"
761
- ],
762
- pathPattern: "^$"
763
- },
764
- {
765
- order: { type: "asc" },
766
- pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"
767
- },
768
- {
769
- order: { type: "asc" },
770
- pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$"
771
- },
772
- {
773
- order: ["types", "import", "require", "default"],
774
- pathPattern: "^exports.*$"
775
- }
776
- ]
777
- }
778
- }
779
- ];
780
- }
781
- async function sortTsconfig() {
782
- return [
783
- {
784
- name: "eslint:sort-tsconfig",
785
- files: ["**/tsconfig.json", "**/tsconfig.*.json"],
786
- rules: {
787
- "jsonc/sort-keys": [
788
- "error",
789
- {
790
- order: [
791
- "extends",
792
- "compilerOptions",
793
- "references",
794
- "files",
795
- "include",
796
- "exclude"
797
- ],
798
- pathPattern: "^$"
799
- },
800
- {
801
- order: [
802
- /* Projects */
803
- "incremental",
804
- "composite",
805
- "tsBuildInfoFile",
806
- "disableSourceOfProjectReferenceRedirect",
807
- "disableSolutionSearching",
808
- "disableReferencedProjectLoad",
809
- /* Language and Environment */
810
- "target",
811
- "jsx",
812
- "jsxFactory",
813
- "jsxFragmentFactory",
814
- "jsxImportSource",
815
- "lib",
816
- "moduleDetection",
817
- "noLib",
818
- "reactNamespace",
819
- "useDefineForClassFields",
820
- "emitDecoratorMetadata",
821
- "experimentalDecorators",
822
- /* Modules */
823
- "baseUrl",
824
- "rootDir",
825
- "rootDirs",
826
- "customConditions",
827
- "module",
828
- "moduleResolution",
829
- "moduleSuffixes",
830
- "noResolve",
831
- "paths",
832
- "resolveJsonModule",
833
- "resolvePackageJsonExports",
834
- "resolvePackageJsonImports",
835
- "typeRoots",
836
- "types",
837
- "allowArbitraryExtensions",
838
- "allowImportingTsExtensions",
839
- "allowUmdGlobalAccess",
840
- /* JavaScript Support */
841
- "allowJs",
842
- "checkJs",
843
- "maxNodeModuleJsDepth",
844
- /* Type Checking */
845
- "strict",
846
- "strictBindCallApply",
847
- "strictFunctionTypes",
848
- "strictNullChecks",
849
- "strictPropertyInitialization",
850
- "allowUnreachableCode",
851
- "allowUnusedLabels",
852
- "alwaysStrict",
853
- "exactOptionalPropertyTypes",
854
- "noFallthroughCasesInSwitch",
855
- "noImplicitAny",
856
- "noImplicitOverride",
857
- "noImplicitReturns",
858
- "noImplicitThis",
859
- "noPropertyAccessFromIndexSignature",
860
- "noUncheckedIndexedAccess",
861
- "noUnusedLocals",
862
- "noUnusedParameters",
863
- "useUnknownInCatchVariables",
864
- /* Emit */
865
- "declaration",
866
- "declarationDir",
867
- "declarationMap",
868
- "downlevelIteration",
869
- "emitBOM",
870
- "emitDeclarationOnly",
871
- "importHelpers",
872
- "importsNotUsedAsValues",
873
- "inlineSourceMap",
874
- "inlineSources",
875
- "mapRoot",
876
- "newLine",
877
- "noEmit",
878
- "noEmitHelpers",
879
- "noEmitOnError",
880
- "outDir",
881
- "outFile",
882
- "preserveConstEnums",
883
- "preserveValueImports",
884
- "removeComments",
885
- "sourceMap",
886
- "sourceRoot",
887
- "stripInternal",
888
- /* Interop Constraints */
889
- "allowSyntheticDefaultImports",
890
- "esModuleInterop",
891
- "forceConsistentCasingInFileNames",
892
- "isolatedModules",
893
- "preserveSymlinks",
894
- "verbatimModuleSyntax",
895
- /* Completeness */
896
- "skipDefaultLibCheck",
897
- "skipLibCheck"
898
- ],
899
- pathPattern: "^compilerOptions$"
900
- }
901
- ]
902
- }
903
- }
904
- ];
905
- }
906
-
907
- // src/configs/typescript.ts
908
- var import_node_process = __toESM(require("process"), 1);
909
- var typeAwareRules = {
910
- "dot-notation": "off",
911
- "no-implied-eval": "off",
912
- "no-throw-literal": "off",
913
- "@typescript-eslint/await-thenable": "error",
914
- "@typescript-eslint/dot-notation": ["error", { allowKeywords: true }],
915
- "@typescript-eslint/no-floating-promises": "error",
916
- "@typescript-eslint/no-for-in-array": "error",
917
- "@typescript-eslint/no-implied-eval": "error",
918
- "@typescript-eslint/no-misused-promises": "error",
919
- "@typescript-eslint/no-throw-literal": "error",
920
- "@typescript-eslint/no-unnecessary-type-assertion": "error",
921
- "@typescript-eslint/no-unsafe-argument": "error",
922
- "@typescript-eslint/no-unsafe-assignment": "error",
923
- "@typescript-eslint/no-unsafe-call": "error",
924
- "@typescript-eslint/no-unsafe-member-access": "error",
925
- "@typescript-eslint/no-unsafe-return": "error",
926
- "@typescript-eslint/restrict-plus-operands": "error",
927
- "@typescript-eslint/restrict-template-expressions": "error",
928
- "@typescript-eslint/unbound-method": "error"
929
- };
930
- async function typescript(options) {
931
- const {
932
- componentExts = [],
933
- parserOptions = {},
934
- tsconfigPath
935
- } = options ?? {};
936
- const [pluginTs, parserTs] = await Promise.all([
937
- interopDefault(import("@typescript-eslint/eslint-plugin")),
938
- interopDefault(import("@typescript-eslint/parser"))
939
- ]);
940
- return [
941
- {
942
- // Install the plugins without globs, so they can be configured separately.
943
- name: "eslint:typescript:setup",
944
- plugins: {
945
- "@typescript-eslint": pluginTs
946
- }
947
- },
948
- {
949
- name: "eslint:typescript:rules",
950
- files: [GLOB_SRC, ...componentExts.map((ext) => `**/*.${ext}`)],
951
- languageOptions: {
952
- parser: parserTs,
953
- parserOptions: {
954
- extraFileExtensions: componentExts.map((ext) => `.${ext}`),
955
- sourceType: "module",
956
- ...tsconfigPath ? {
957
- project: [tsconfigPath],
958
- tsconfigRootDir: import_node_process.default.cwd()
959
- } : {},
960
- ...parserOptions
961
- }
962
- },
963
- rules: {
964
- ...pluginTs.configs["eslint-recommended"].overrides[0].rules,
965
- ...pluginTs.configs.strict.rules,
966
- "no-dupe-class-members": "off",
967
- "no-invalid-this": "off",
968
- "no-loss-of-precision": "off",
969
- "no-redeclare": "off",
970
- "no-use-before-define": "off",
971
- "no-useless-constructor": "off",
972
- "@typescript-eslint/ban-ts-comment": [
973
- "error",
974
- { "ts-ignore": "allow-with-description" }
975
- ],
976
- "@typescript-eslint/ban-types": [
977
- "error",
978
- { types: { Function: false } }
979
- ],
980
- "@typescript-eslint/consistent-type-definitions": [
981
- "error",
982
- "interface"
983
- ],
984
- "@typescript-eslint/consistent-type-imports": [
985
- "error",
986
- { disallowTypeAnnotations: false, prefer: "type-imports" }
987
- ],
988
- "@typescript-eslint/no-dupe-class-members": "error",
989
- "@typescript-eslint/no-dynamic-delete": "off",
990
- "@typescript-eslint/no-explicit-any": "off",
991
- "@typescript-eslint/no-extraneous-class": "off",
992
- "@typescript-eslint/no-import-type-side-effects": "error",
993
- "@typescript-eslint/no-invalid-this": "error",
994
- "@typescript-eslint/no-invalid-void-type": "off",
995
- "@typescript-eslint/no-loss-of-precision": "error",
996
- "@typescript-eslint/no-non-null-assertion": "off",
997
- "@typescript-eslint/no-redeclare": "error",
998
- "@typescript-eslint/no-require-imports": "error",
999
- "@typescript-eslint/no-unused-vars": "off",
1000
- "@typescript-eslint/no-use-before-define": [
1001
- "error",
1002
- { classes: false, functions: false, variables: true }
1003
- ],
1004
- "@typescript-eslint/no-useless-constructor": "off",
1005
- "@typescript-eslint/prefer-ts-expect-error": "error",
1006
- "@typescript-eslint/triple-slash-reference": "off",
1007
- "@typescript-eslint/unified-signatures": "off",
1008
- ...tsconfigPath ? typeAwareRules : {}
1009
- }
1010
- },
1011
- {
1012
- name: "eslint:typescript:dts-overrides",
1013
- files: ["**/*.d.ts"],
1014
- rules: {
1015
- "eslint-comments/no-unlimited-disable": "off",
1016
- "import/no-duplicates": "off",
1017
- "no-restricted-syntax": "off",
1018
- "unused-imports/no-unused-vars": "off"
1019
- }
1020
- },
1021
- {
1022
- name: "eslint:typescript:tests-overrides",
1023
- files: ["**/*.{test,spec}.ts?(x)"],
1024
- rules: {
1025
- "no-unused-expressions": "off"
1026
- }
1027
- },
1028
- {
1029
- files: ["**/*.js", "**/*.cjs"],
1030
- name: "eslint:typescript:javascript-overrides",
1031
- rules: {
1032
- "@typescript-eslint/no-require-imports": "off",
1033
- "@typescript-eslint/no-var-requires": "off"
1034
- }
1035
- }
1036
- ];
1037
- }
1038
-
1039
- // src/configs/unicorn.ts
1040
- async function unicorn() {
1041
- const pluginUnicorn = await interopDefault(import("eslint-plugin-unicorn"));
1042
- return [
1043
- {
1044
- name: "eslint:unicorn",
1045
- plugins: {
1046
- unicorn: pluginUnicorn
1047
- },
1048
- rules: {
1049
- // Pass error message when throwing errors
1050
- "unicorn/error-message": "error",
1051
- // Uppercase regex escapes
1052
- "unicorn/escape-case": "error",
1053
- // Array.isArray instead of instanceof
1054
- "unicorn/no-instanceof-array": "error",
1055
- // Ban `new Array` as `Array` constructor's params are ambiguous
1056
- "unicorn/no-new-array": "error",
1057
- // Prevent deprecated `new Buffer()`
1058
- "unicorn/no-new-buffer": "error",
1059
- // Lowercase number formatting for octal, hex, binary (0x1'error' instead of 0X1'error')
1060
- "unicorn/number-literal-case": "error",
1061
- // textContent instead of innerText
1062
- "unicorn/prefer-dom-node-text-content": "error",
1063
- // includes over indexOf when checking for existence
1064
- "unicorn/prefer-includes": "error",
1065
- // Prefer using the node: protocol
1066
- "unicorn/prefer-node-protocol": "error",
1067
- // Prefer using number properties like `Number.isNaN` rather than `isNaN`
1068
- "unicorn/prefer-number-properties": "error",
1069
- // String methods startsWith/endsWith instead of more complicated stuff
1070
- "unicorn/prefer-string-starts-ends-with": "error",
1071
- // Enforce throwing type error when throwing error while checking typeof
1072
- "unicorn/prefer-type-error": "error",
1073
- // Use new when throwing error
1074
- "unicorn/throw-new-error": "error"
1075
- }
1076
- }
1077
- ];
1078
- }
1079
-
1080
- // src/configs/vue.ts
1081
- async function vue(options = {}) {
1082
- const [pluginVue, parserVue] = await Promise.all([
1083
- // @ts-expect-error missing types
1084
- interopDefault(import("eslint-plugin-vue")),
1085
- interopDefault(import("vue-eslint-parser"))
1086
- ]);
1087
- return [
1088
- {
1089
- name: "eslint:vue:setup",
1090
- plugins: {
1091
- vue: pluginVue
1092
- }
1093
- },
1094
- {
1095
- name: "eslint:vue:rules",
1096
- files: [GLOB_VUE],
1097
- languageOptions: {
1098
- parser: parserVue,
1099
- parserOptions: {
1100
- ecmaFeatures: {
1101
- jsx: true
1102
- },
1103
- extraFileExtensions: [".vue"],
1104
- parser: options.typescript ? await interopDefault(
1105
- import("@typescript-eslint/parser")
1106
- ) : null,
1107
- sourceType: "module"
1108
- }
1109
- },
1110
- processor: pluginVue.processors[".vue"],
1111
- rules: {
1112
- ...pluginVue.configs.base.rules,
1113
- ...pluginVue.configs["vue3-essential"].rules,
1114
- ...pluginVue.configs["vue3-strongly-recommended"].rules,
1115
- ...pluginVue.configs["vue3-recommended"].rules,
1116
- "node/prefer-global/process": "off",
1117
- "vue/block-order": [
1118
- "error",
1119
- {
1120
- order: ["script", "template", "style"]
1121
- }
1122
- ],
1123
- "vue/component-name-in-template-casing": [
1124
- "error",
1125
- "PascalCase",
1126
- {
1127
- registeredComponentsOnly: false
1128
- }
1129
- ],
1130
- "vue/component-options-name-casing": ["error", "PascalCase"],
1131
- "vue/custom-event-name-casing": ["error", "camelCase"],
1132
- "vue/define-macros-order": [
1133
- "error",
1134
- {
1135
- order: [
1136
- "defineOptions",
1137
- "defineProps",
1138
- "defineEmits",
1139
- "defineSlots"
1140
- ]
1141
- }
1142
- ],
1143
- "vue/dot-location": ["error", "property"],
1144
- "vue/dot-notation": ["error", { allowKeywords: true }],
1145
- "vue/eqeqeq": ["error", "smart"],
1146
- "vue/html-indent": ["error", 2],
1147
- "vue/html-quotes": ["error", "double"],
1148
- "vue/max-attributes-per-line": "off",
1149
- "vue/multi-word-component-names": "off",
1150
- "vue/no-dupe-keys": "off",
1151
- "vue/no-empty-pattern": "error",
1152
- "vue/no-extra-parens": ["error", "functions"],
1153
- "vue/no-irregular-whitespace": "error",
1154
- "vue/no-loss-of-precision": "error",
1155
- "vue/no-restricted-syntax": [
1156
- "error",
1157
- "DebuggerStatement",
1158
- "LabeledStatement",
1159
- "WithStatement"
1160
- ],
1161
- "vue/no-restricted-v-bind": ["error", "/^v-/"],
1162
- "vue/no-setup-props-reactivity-loss": "off",
1163
- "vue/no-sparse-arrays": "error",
1164
- "vue/no-unused-refs": "error",
1165
- "vue/no-useless-v-bind": "error",
1166
- "vue/no-v-html": "off",
1167
- "vue/object-shorthand": [
1168
- "error",
1169
- "always",
1170
- {
1171
- avoidQuotes: true,
1172
- ignoreConstructors: false
1173
- }
1174
- ],
1175
- "vue/prefer-separate-static-class": "error",
1176
- "vue/prefer-template": "error",
1177
- "vue/require-default-prop": "off",
1178
- "vue/require-prop-types": "off",
1179
- "vue/space-infix-ops": "error",
1180
- "vue/space-unary-ops": ["error", { nonwords: false, words: true }],
1181
- "vue/array-bracket-spacing": ["error", "never"],
1182
- "vue/arrow-spacing": ["error", { after: true, before: true }],
1183
- "vue/block-spacing": ["error", "always"],
1184
- "vue/block-tag-newline": [
1185
- "error",
1186
- {
1187
- multiline: "always",
1188
- singleline: "always"
1189
- }
1190
- ],
1191
- "vue/brace-style": ["error", "stroustrup", { allowSingleLine: true }],
1192
- "vue/comma-dangle": ["error", "always-multiline"],
1193
- "vue/comma-spacing": ["error", { after: true, before: false }],
1194
- "vue/comma-style": ["error", "last"],
1195
- "vue/html-comment-content-spacing": [
1196
- "error",
1197
- "always",
1198
- {
1199
- exceptions: ["-"]
1200
- }
1201
- ],
1202
- "vue/key-spacing": ["error", { afterColon: true, beforeColon: false }],
1203
- "vue/keyword-spacing": ["error", { after: true, before: true }],
1204
- "vue/object-curly-newline": "off",
1205
- "vue/object-curly-spacing": ["error", "always"],
1206
- "vue/object-property-newline": [
1207
- "error",
1208
- { allowMultiplePropertiesPerLine: true }
1209
- ],
1210
- "vue/operator-linebreak": ["error", "before"],
1211
- "vue/padding-line-between-blocks": ["error", "always"],
1212
- "vue/quote-props": ["error", "consistent-as-needed"],
1213
- "vue/space-in-parens": ["error", "never"],
1214
- "vue/template-curly-spacing": "error"
1215
- }
1216
- }
1217
- ];
1218
- }
1219
-
1220
- // src/configs/yml.ts
1221
- async function yml() {
1222
- const [pluginYml, parserYml] = await Promise.all([
1223
- interopDefault(import("eslint-plugin-yml")),
1224
- interopDefault(import("yaml-eslint-parser"))
1225
- ]);
1226
- return [
1227
- {
1228
- name: "eslint:yaml:setup",
1229
- plugins: {
1230
- yml: pluginYml
1231
- }
1232
- },
1233
- {
1234
- name: "eslint:yaml:rules",
1235
- files: [GLOB_YAML],
1236
- languageOptions: {
1237
- parser: parserYml
1238
- },
1239
- rules: {
1240
- ...pluginYml.configs.standard.rules,
1241
- ...pluginYml.configs.prettier.rules,
1242
- "yml/block-mapping": "error",
1243
- "yml/block-sequence": "error",
1244
- "yml/no-empty-key": "error",
1245
- "yml/no-empty-sequence-entry": "error",
1246
- "yml/no-irregular-whitespace": "error",
1247
- "yml/plain-scalar": "error",
1248
- "yml/vue-custom-block/no-parsing-error": "error",
1249
- "yml/spaced-comment": "error"
1250
- }
1251
- }
1252
- ];
1253
- }
1254
-
1255
- // src/configs/toml.ts
1256
- async function toml() {
1257
- const [pluginToml, parserToml] = await Promise.all([
1258
- interopDefault(import("eslint-plugin-toml")),
1259
- interopDefault(import("toml-eslint-parser"))
1260
- ]);
1261
- return [
1262
- {
1263
- name: "eslint:toml:setup",
1264
- plugins: {
1265
- toml: pluginToml
1266
- }
1267
- },
1268
- {
1269
- name: "eslint:toml:rules",
1270
- files: [GLOB_TOML],
1271
- languageOptions: {
1272
- parser: parserToml
1273
- },
1274
- rules: {
1275
- "style/spaced-comment": "off",
1276
- "toml/comma-style": "error",
1277
- "toml/keys-order": "error",
1278
- "toml/no-space-dots": "error",
1279
- "toml/no-unreadable-number-separator": "error",
1280
- "toml/precision-of-fractional-seconds": "error",
1281
- "toml/precision-of-integer": "error",
1282
- "toml/tables-order": "error",
1283
- "toml/vue-custom-block/no-parsing-error": "error",
1284
- "toml/array-bracket-newline": "error",
1285
- "toml/array-bracket-spacing": "error",
1286
- "toml/array-element-newline": "error",
1287
- "toml/indent": ["error", 2],
1288
- "toml/inline-table-curly-spacing": "error",
1289
- "toml/key-spacing": "error",
1290
- "toml/padding-line-between-pairs": "error",
1291
- "toml/padding-line-between-tables": "error",
1292
- "toml/quoted-keys": "error",
1293
- "toml/spaced-comment": "error",
1294
- "toml/table-bracket-spacing": "error"
1295
- }
1296
- }
1297
- ];
1298
- }
1299
-
1300
- // src/configs/test.ts
1301
- async function test() {
1302
- const [pluginVitest, pluginNoOnlyTests] = await Promise.all([
1303
- interopDefault(import("eslint-plugin-vitest")),
1304
- // @ts-expect-error missing types
1305
- interopDefault(import("eslint-plugin-no-only-tests"))
1306
- ]);
1307
- return [
1308
- {
1309
- name: "eslint:test:setup",
1310
- plugins: {
1311
- test: {
1312
- ...pluginVitest,
1313
- rules: {
1314
- ...pluginVitest.rules,
1315
- // extend `test/no-only-tests` rule
1316
- ...pluginNoOnlyTests.rules
1317
- }
1318
- }
1319
- }
1320
- },
1321
- {
1322
- name: "eslint:test:rules",
1323
- files: GLOB_TESTS,
1324
- rules: {
1325
- "test/consistent-test-it": [
1326
- "error",
1327
- { fn: "it", withinDescribe: "it" }
1328
- ],
1329
- "test/no-identical-title": "error",
1330
- "test/no-only-tests": "error",
1331
- "test/prefer-hooks-in-order": "error",
1332
- "test/prefer-lowercase-title": "error"
1333
- }
1334
- }
1335
- ];
1336
- }
1337
-
1338
- // src/configs/perfectionist.ts
1339
- async function perfectionist() {
1340
- const pluginPerfectionist = await interopDefault(
1341
- // @ts-expect-error missing types
1342
- import("eslint-plugin-perfectionist")
1343
- );
1344
- return [
1345
- {
1346
- name: "eslint:perfectionist",
1347
- plugins: {
1348
- perfectionist: pluginPerfectionist
1349
- }
1350
- }
1351
- ];
1352
- }
1353
-
1354
- // src/configs/prettier.ts
1355
- async function prettier(options) {
1356
- const [pluginPrettier, configPrettier, parserPlain] = await Promise.all([
1357
- interopDefault(import("eslint-plugin-prettier")),
1358
- // @ts-expect-error missing types
1359
- interopDefault(import("eslint-config-prettier")),
1360
- interopDefault(import("eslint-parser-plain"))
1361
- ]);
1362
- const PlainFileRules = [
1363
- {
1364
- name: "eslint:prettier:markdown",
1365
- files: [GLOB_MARKDOWN],
1366
- parser: "markdown"
1367
- },
1368
- {
1369
- name: "eslint:prettier:mdx",
1370
- files: [GLOB_MDX],
1371
- parser: "mdx"
1372
- },
1373
- {
1374
- name: "eslint:prettier:html",
1375
- files: ["**/*.html"],
1376
- parser: "html"
1377
- },
1378
- {
1379
- name: "eslint:prettier:css",
1380
- files: [GLOB_CSS, GLOB_POSTCSS],
1381
- parser: "css"
1382
- },
1383
- {
1384
- name: "eslint:prettier:scss",
1385
- files: [GLOB_SCSS],
1386
- parser: "scss"
1387
- },
1388
- {
1389
- name: "eslint:prettier:less",
1390
- files: [GLOB_LESS],
1391
- parser: "less"
1392
- },
1393
- {
1394
- name: "eslint:prettier:yaml",
1395
- files: [GLOB_YAML],
1396
- parser: "yaml"
1397
- },
1398
- {
1399
- name: "eslint:prettier:graphql",
1400
- files: ["**/*.graphql"],
1401
- parser: "graphql"
1402
- }
1403
- ].map((rule) => ({
1404
- name: rule.name,
1405
- files: rule.files,
1406
- languageOptions: {
1407
- parser: parserPlain
1408
- },
1409
- rules: {
1410
- "prettier/prettier": [
1411
- "warn",
1412
- {
1413
- quoteProps: "consistent",
1414
- parser: rule.parser,
1415
- ...options
1416
- }
1417
- ]
1418
- }
1419
- }));
1420
- return [
1421
- {
1422
- name: "eslint:prettier:setup",
1423
- plugins: {
1424
- prettier: pluginPrettier
1425
- }
1426
- },
1427
- {
1428
- name: "eslint:prettier:rules",
1429
- ignores: [GLOB_TOML],
1430
- rules: {
1431
- ...configPrettier.rules,
1432
- ...pluginPrettier.configs.recommended.rules,
1433
- "prettier/prettier": [
1434
- "warn",
1435
- {
1436
- quoteProps: "consistent",
1437
- ...options
1438
- }
1439
- ]
1440
- }
1441
- },
1442
- ...PlainFileRules
1443
- ];
1444
- }
1445
-
1446
- // src/configs/react.ts
1447
- async function next() {
1448
- const pluginNext = await interopDefault(import("@next/eslint-plugin-next"));
1449
- return [
1450
- {
1451
- name: "eslint:next:setup",
1452
- plugins: {
1453
- "@next/next": pluginNext
1454
- }
1455
- },
1456
- {
1457
- name: "eslint:next:rules",
1458
- files: [GLOB_TSX, GLOB_JSX],
1459
- languageOptions: {
1460
- parserOptions: {
1461
- sourceType: "module",
1462
- ecmaFeatures: {
1463
- jsx: true
1464
- }
1465
- }
1466
- },
1467
- settings: {
1468
- react: {
1469
- version: "detect"
1470
- }
1471
- },
1472
- rules: {
1473
- ...pluginNext.configs.recommended.rules,
1474
- ...pluginNext.configs["core-web-vitals"].rules
1475
- }
1476
- }
1477
- ];
1478
- }
1479
- async function react(options = {}) {
1480
- const { next: enableNext = false } = options;
1481
- const [pluginReact, pluginReactHooks] = await Promise.all([
1482
- // @ts-expect-error missing types
1483
- interopDefault(import("eslint-plugin-react")),
1484
- // @ts-expect-error missing types
1485
- interopDefault(import("eslint-plugin-react-hooks"))
1486
- ]);
1487
- const _react = [
1488
- {
1489
- name: "eslint:react:setup",
1490
- plugins: {
1491
- "react": pluginReact,
1492
- "react-hooks": pluginReactHooks
1493
- }
1494
- },
1495
- {
1496
- name: "eslint:react:rules",
1497
- files: [GLOB_TSX, GLOB_JSX],
1498
- languageOptions: {
1499
- parserOptions: {
1500
- sourceType: "module",
1501
- ecmaFeatures: {
1502
- jsx: true
1503
- }
1504
- }
1505
- },
1506
- settings: {
1507
- react: {
1508
- version: "detect"
1509
- }
1510
- },
1511
- rules: {
1512
- ...pluginReact.configs.recommended.rules,
1513
- ...pluginReactHooks.configs.recommended.rules,
1514
- "jsx-quotes": ["error", "prefer-double"],
1515
- "react/react-in-jsx-scope": "off",
1516
- "react/jsx-indent": [1, 2],
1517
- "react/jsx-indent-props": [1, 2],
1518
- "react/jsx-closing-bracket-location": [
1519
- 1,
1520
- { selfClosing: "tag-aligned", nonEmpty: "tag-aligned" }
1521
- ]
1522
- }
1523
- }
1524
- ];
1525
- return combine(_react, enableNext ? next() : []);
1526
- }
1527
-
1528
- // src/configs/tailwindcss.ts
1529
- async function tailwindcss() {
1530
- const pluginTailwindcss = await interopDefault(
1531
- // @ts-expect-error missing types
1532
- import("eslint-plugin-tailwindcss")
1533
- );
1534
- return [
1535
- {
1536
- name: "eslint:tailwindcss",
1537
- plugins: {
1538
- tailwindcss: pluginTailwindcss
1539
- },
1540
- rules: {
1541
- ...pluginTailwindcss.configs.recommended.rules
1542
- }
1543
- }
1544
- ];
1545
- }
1546
-
1547
- // src/factory.ts
1548
- function config(options = {}) {
1549
- const {
1550
- vue: enableVue,
1551
- react: enableReact,
1552
- typescript: enableTypeScript,
1553
- gitignore: enableGitignore = true,
1554
- tailwindcss: enableTailwindcss,
1555
- componentExts = []
1556
- } = options;
1557
- const configs = [];
1558
- configs.push(
1559
- ignores({
1560
- enableGitignore
1561
- }),
1562
- javascript(),
1563
- comments(),
1564
- node(),
1565
- jsdoc(),
1566
- imports(),
1567
- unicorn(),
1568
- perfectionist()
1569
- );
1570
- if (enableVue)
1571
- componentExts.push("vue");
1572
- if (enableTypeScript) {
1573
- configs.push(
1574
- typescript({
1575
- ...typeof enableTypeScript !== "boolean" ? enableTypeScript : {},
1576
- componentExts
1577
- })
1578
- );
1579
- }
1580
- if (options.test ?? true) {
1581
- configs.push(test());
1582
- }
1583
- if (enableVue) {
1584
- configs.push(
1585
- vue({
1586
- typescript: !!enableTypeScript
1587
- })
1588
- );
1589
- }
1590
- if (enableReact) {
1591
- configs.push(react(typeof enableReact !== "boolean" ? enableReact : {}));
1592
- }
1593
- if (options.jsonc ?? true) {
1594
- configs.push(jsonc(), sortPackageJson(), sortTsconfig());
1595
- }
1596
- if (options.yml ?? true) {
1597
- configs.push(yml());
1598
- }
1599
- if (options.toml ?? true) {
1600
- configs.push(toml());
1601
- }
1602
- if (options.markdown ?? true) {
1603
- configs.push(
1604
- markdown({
1605
- componentExts
1606
- })
1607
- );
1608
- }
1609
- if (enableTailwindcss) {
1610
- configs.push(tailwindcss());
1611
- }
1612
- if (options.prettier ?? true) {
1613
- configs.push(
1614
- prettier({
1615
- ...typeof options.prettier !== "boolean" ? options.prettier : {}
1616
- })
1617
- );
1618
- }
1619
- const merged = combine(...configs, options.customConfig ?? []);
1620
- return merged;
1621
- }
1622
-
1623
- // src/index.ts
1624
- var src_default = config;
1625
- // Annotate the CommonJS export names for ESM import in node:
1626
- 0 && (module.exports = {
1627
- GLOB_ALL_SRC,
1628
- GLOB_CSS,
1629
- GLOB_EXCLUDE,
1630
- GLOB_HTML,
1631
- GLOB_JS,
1632
- GLOB_JSON,
1633
- GLOB_JSON5,
1634
- GLOB_JSONC,
1635
- GLOB_JSX,
1636
- GLOB_LESS,
1637
- GLOB_MARKDOWN,
1638
- GLOB_MARKDOWN_CODE,
1639
- GLOB_MDX,
1640
- GLOB_POSTCSS,
1641
- GLOB_SCSS,
1642
- GLOB_SRC,
1643
- GLOB_SRC_EXT,
1644
- GLOB_STYLE,
1645
- GLOB_TESTS,
1646
- GLOB_TOML,
1647
- GLOB_TS,
1648
- GLOB_TSX,
1649
- GLOB_VUE,
1650
- GLOB_YAML,
1651
- combine,
1652
- comments,
1653
- config,
1654
- ignores,
1655
- imports,
1656
- interopDefault,
1657
- javascript,
1658
- jsdoc,
1659
- jsonc,
1660
- markdown,
1661
- node,
1662
- perfectionist,
1663
- prettier,
1664
- sortPackageJson,
1665
- sortTsconfig,
1666
- test,
1667
- toml,
1668
- typescript,
1669
- unicorn,
1670
- vue,
1671
- yml
1672
- });
1
+ "use strict";var ae=Object.create;var v=Object.defineProperty;var pe=Object.getOwnPropertyDescriptor;var le=Object.getOwnPropertyNames;var ce=Object.getPrototypeOf,me=Object.prototype.hasOwnProperty;var ue=(e,o)=>{for(var t in o)v(e,t,{get:o[t],enumerable:!0})},ee=(e,o,t,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of le(o))!me.call(e,i)&&i!==t&&v(e,i,{get:()=>o[i],enumerable:!(s=pe(o,i))||s.enumerable});return e};var n=(e,o,t)=>(t=e!=null?ae(ce(e)):{},ee(o||!e||!e.__esModule?v(t,"default",{value:e,enumerable:!0}):t,e)),fe=e=>ee(v({},"__esModule",{value:!0}),e);var Oe={};ue(Oe,{GLOB_ALL_SRC:()=>ye,GLOB_CSS:()=>T,GLOB_EXCLUDE:()=>S,GLOB_HTML:()=>oe,GLOB_JS:()=>de,GLOB_JSON:()=>O,GLOB_JSON5:()=>h,GLOB_JSONC:()=>I,GLOB_JSX:()=>C,GLOB_LESS:()=>L,GLOB_MARKDOWN:()=>f,GLOB_MARKDOWN_CODE:()=>D,GLOB_MDX:()=>y,GLOB_POSTCSS:()=>_,GLOB_SCSS:()=>G,GLOB_SRC:()=>d,GLOB_SRC_EXT:()=>u,GLOB_STYLE:()=>re,GLOB_TESTS:()=>B,GLOB_TOML:()=>x,GLOB_TS:()=>ge,GLOB_TSX:()=>w,GLOB_VUE:()=>j,GLOB_YAML:()=>g,combine:()=>b,comments:()=>P,config:()=>Z,default:()=>we,ignores:()=>F,imports:()=>R,interopDefault:()=>r,javascript:()=>q,jsdoc:()=>M,jsonc:()=>A,markdown:()=>J,node:()=>U,perfectionist:()=>z,prettier:()=>Q,sortPackageJson:()=>N,sortTsconfig:()=>$,test:()=>K,toml:()=>H,typescript:()=>V,unicorn:()=>W,vue:()=>X,yml:()=>Y});module.exports=fe(Oe);async function P(){return[{name:"eslint:eslint-comments",plugins:{"eslint-comments":await r(import("eslint-plugin-eslint-comments"))},rules:{"eslint-comments/no-aggregating-enable":"error","eslint-comments/no-duplicate-disable":"error","eslint-comments/no-unlimited-disable":"error","eslint-comments/no-unused-enable":"error"}}]}var E=n(require("fs"),1),te=n(require("path"),1);var u="?([cm])[jt]s?(x)",d="**/*.?([cm])[jt]s?(x)",de="**/*.?([cm])js",C="**/*.?([cm])jsx",ge="**/*.?([cm])ts",w="**/*.?([cm])tsx",re="**/*.{c,le,sc}ss",T="**/*.css",_="**/*.{p,post}css",L="**/*.less",G="**/*.scss",O="**/*.json",h="**/*.json5",I="**/*.jsonc",f="**/*.md",y="**/*.mdx",D=`${f}/${d}`,j="**/*.vue",g="**/*.y?(a)ml",x="**/*.toml",oe="**/*.htm?(l)",B=[`**/__tests__/**/*.${u}`,`**/*.spec.${u}`,`**/*.test.${u}`,`**/*.bench.${u}`,`**/*.benchmark.${u}`],ye=[d,re,O,h,f,j,g,oe],S=["**/node_modules","**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb","**/output","**/coverage","**/temp","**/.vitepress/cache","**/.nuxt","**/.next","**/.vercel","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts"];var xe=/\r?\n/g,be=e=>e.split(xe),F=async e=>{let{enableGitignore:o=!0,files:t=[]}=e,s=[];if(o){let l=".gitignore";typeof o!="boolean"&&(l=o.ignorePath);let m=te.default.join(process.cwd(),l);E.default.existsSync(m)&&(s=be(E.default.readFileSync(m).toString()).filter(p=>!(p.startsWith("#")||p.length===0)).map(p=>p.startsWith("/")?p.slice(1):p))}let i=[...S,...s];return typeof t=="function"?i=t(i):i=[...i,...t],[{ignores:[...S,...i]}]};async function b(...e){return(await Promise.all(e)).flat()}async function r(e){let o=await e;return o.default||o}async function R(){return[{name:"eslint:imports",plugins:{import:await r(import("eslint-plugin-i"))},rules:{"import/first":"error","import/no-duplicates":"error","import/no-mutable-exports":"error","import/no-named-default":"error","import/no-self-import":"error","import/no-webpack-loader-syntax":"error","import/order":"error","import/newline-after-import":["error",{considerComments:!0,count:1}]}}]}var k=n(require("globals"),1);var q=async e=>{let{overrides:o={}}=e,t=await r(import("eslint-plugin-unused-imports"));return[{name:"eslint:javascript",languageOptions:{ecmaVersion:2022,globals:{...k.default.browser,...k.default.es2021,...k.default.node,document:"readonly",navigator:"readonly",window:"readonly"},parserOptions:{ecmaFeatures:{jsx:!0},ecmaVersion:2022,sourceType:"module"},sourceType:"module"},linterOptions:{reportUnusedDisableDirectives:!0},plugins:{"unused-imports":t},rules:{"accessor-pairs":["error",{enforceForClassMembers:!0,setWithoutGet:!0}],"array-callback-return":"error","block-scoped-var":"error","constructor-super":"error","default-case-last":"error","dot-notation":["error",{allowKeywords:!0}],eqeqeq:["error","smart"],"new-cap":["error",{capIsNew:!1,newIsCap:!0,properties:!0}],"no-alert":"error","no-array-constructor":"error","no-async-promise-executor":"error","no-caller":"error","no-case-declarations":"error","no-class-assign":"error","no-compare-neg-zero":"error","no-cond-assign":["error","always"],"no-console":["error",{allow:["warn","error"]}],"no-const-assign":"error","no-control-regex":"error","no-debugger":"error","no-delete-var":"error","no-dupe-args":"error","no-dupe-class-members":"error","no-dupe-keys":"error","no-duplicate-case":"error","no-empty":["error",{allowEmptyCatch:!0}],"no-empty-character-class":"error","no-empty-pattern":"error","no-eval":"error","no-ex-assign":"error","no-extend-native":"error","no-extra-bind":"error","no-extra-boolean-cast":"error","no-fallthrough":"error","no-func-assign":"error","no-global-assign":"error","no-implied-eval":"error","no-import-assign":"error","no-invalid-regexp":"error","no-invalid-this":"error","no-irregular-whitespace":"error","no-iterator":"error","no-labels":["error",{allowLoop:!1,allowSwitch:!1}],"no-lone-blocks":"error","no-loss-of-precision":"error","no-misleading-character-class":"error","no-multi-str":"error","no-new":"error","no-new-func":"error","no-new-object":"error","no-new-symbol":"error","no-new-wrappers":"error","no-obj-calls":"error","no-octal":"error","no-octal-escape":"error","no-proto":"error","no-prototype-builtins":"error","no-redeclare":["error",{builtinGlobals:!1}],"no-regex-spaces":"error","no-restricted-globals":["error",{message:"Use `globalThis` instead.",name:"global"},{message:"Use `globalThis` instead.",name:"self"}],"no-restricted-properties":["error",{message:"Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.",property:"__proto__"},{message:"Use `Object.defineProperty` instead.",property:"__defineGetter__"},{message:"Use `Object.defineProperty` instead.",property:"__defineSetter__"},{message:"Use `Object.getOwnPropertyDescriptor` instead.",property:"__lookupGetter__"},{message:"Use `Object.getOwnPropertyDescriptor` instead.",property:"__lookupSetter__"}],"no-restricted-syntax":["error","DebuggerStatement","LabeledStatement","WithStatement","TSEnumDeclaration[const=true]","TSExportAssignment"],"no-self-assign":["error",{props:!0}],"no-self-compare":"error","no-sequences":"error","no-shadow-restricted-names":"error","no-sparse-arrays":"error","no-template-curly-in-string":"error","no-this-before-super":"error","no-throw-literal":"error","no-undef":"error","no-undef-init":"error","no-unexpected-multiline":"error","no-unmodified-loop-condition":"error","no-unneeded-ternary":["error",{defaultAssignment:!1}],"no-unreachable":"error","no-unreachable-loop":"error","no-unsafe-finally":"error","no-unsafe-negation":"error","no-unused-expressions":["error",{allowShortCircuit:!0,allowTaggedTemplates:!0,allowTernary:!0}],"no-unused-vars":["error",{args:"none",caughtErrors:"none",ignoreRestSiblings:!0,vars:"all"}],"no-use-before-define":["error",{classes:!1,functions:!1,variables:!0}],"no-useless-backreference":"error","no-useless-call":"error","no-useless-catch":"error","no-useless-computed-key":"error","no-useless-constructor":"error","no-useless-rename":"error","no-useless-return":"error","no-var":"error","no-with":"error","object-shorthand":["error","always",{avoidQuotes:!0,ignoreConstructors:!1}],"one-var":["error",{initialized:"never"}],"prefer-arrow-callback":["error",{allowNamedFunctions:!1,allowUnboundThis:!0}],"prefer-const":["error",{destructuring:"all",ignoreReadBeforeAssign:!0}],"prefer-exponentiation-operator":"error","prefer-promise-reject-errors":"error","prefer-regex-literals":["error",{disallowRedundantWrapping:!0}],"prefer-rest-params":"error","prefer-spread":"error","prefer-template":"error","sort-imports":["error",{allowSeparatedGroups:!1,ignoreCase:!1,ignoreDeclarationSort:!0,ignoreMemberSort:!1,memberSyntaxSortOrder:["none","all","multiple","single"]}],"symbol-description":"error","unicode-bom":["error","never"],"unused-imports/no-unused-imports":"warn","unused-imports/no-unused-vars":["error",{args:"after-used",argsIgnorePattern:"^_",vars:"all",varsIgnorePattern:"^_"}],"use-isnan":["error",{enforceForIndexOf:!0,enforceForSwitchCase:!0}],"valid-typeof":["error",{requireStringLiterals:!0}],"vars-on-top":"error",yoda:["error","never"],...o}},{name:"eslint:scripts-overrides",files:[`scripts/${d}`,`cli.${u}`],rules:{"no-console":"off"}}]};async function M(){return[{name:"eslint:jsdoc",plugins:{jsdoc:await r(import("eslint-plugin-jsdoc"))},rules:{"jsdoc/check-access":"warn","jsdoc/check-param-names":"warn","jsdoc/check-property-names":"warn","jsdoc/check-types":"warn","jsdoc/empty-tags":"warn","jsdoc/implements-on-classes":"warn","jsdoc/no-defaults":"warn","jsdoc/no-multi-asterisks":"warn","jsdoc/require-param-name":"warn","jsdoc/require-property":"warn","jsdoc/require-property-description":"warn","jsdoc/require-property-name":"warn","jsdoc/require-returns-check":"warn","jsdoc/require-returns-description":"warn","jsdoc/require-yields-check":"warn","jsdoc/check-alignment":"warn","jsdoc/multiline-blocks":"warn"}}]}var A=async e=>{let{overrides:o={}}=e,[t,s]=await Promise.all([r(import("eslint-plugin-jsonc")),r(import("jsonc-eslint-parser"))]);return[{name:"eslint:jsonc:setup",plugins:{jsonc:t}},{name:"eslint:jsonc:rules",files:[O,h,I],languageOptions:{parser:s},rules:{"jsonc/no-bigint-literals":"error","jsonc/no-binary-expression":"error","jsonc/no-binary-numeric-literals":"error","jsonc/no-dupe-keys":"error","jsonc/no-escape-sequence-in-identifier":"error","jsonc/no-floating-decimal":"error","jsonc/no-hexadecimal-numeric-literals":"error","jsonc/no-infinity":"error","jsonc/no-multi-str":"error","jsonc/no-nan":"error","jsonc/no-number-props":"error","jsonc/no-numeric-separators":"error","jsonc/no-octal":"error","jsonc/no-octal-escape":"error","jsonc/no-octal-numeric-literals":"error","jsonc/no-parenthesized":"error","jsonc/no-plus-sign":"error","jsonc/no-regexp-literals":"error","jsonc/no-sparse-arrays":"error","jsonc/no-template-literals":"error","jsonc/no-undefined-value":"error","jsonc/no-unicode-codepoint-escapes":"error","jsonc/no-useless-escape":"error","jsonc/space-unary-ops":"error","jsonc/valid-json-number":"error","jsonc/vue-custom-block/no-parsing-error":"error","jsonc/array-bracket-spacing":["error","never"],"jsonc/comma-dangle":["error","never"],"jsonc/comma-style":["error","last"],"jsonc/indent":["error",2],"jsonc/key-spacing":["error",{afterColon:!0,beforeColon:!1}],"jsonc/object-curly-newline":["error",{consistent:!0,multiline:!0}],"jsonc/object-curly-spacing":["error","always"],"jsonc/object-property-newline":["error",{allowMultiplePropertiesPerLine:!0}],"jsonc/quote-props":"error","jsonc/quotes":"error",...o}}]};var J=async e=>{let{componentExts:o=[],overrides:t={}}=e,[s,i]=await Promise.all([r(import("eslint-plugin-mdx")),r(import("eslint-mdx"))]);return[{name:"eslint:markdown:setup",plugins:{mdx:s}},{name:"eslint:markdown:processor",files:[f,y],languageOptions:{ecmaVersion:"latest",parser:i,sourceType:"module"},processor:"mdx/remark",settings:{"mdx/code-blocks":!0}},{name:"eslint:markdown:rules",files:[D,...o.map(l=>`${f}/**/*.${l}`)],languageOptions:{parserOptions:{ecmaFeatures:{impliedStrict:!0}}},rules:{"no-alert":"off","no-console":"off","no-undef":"off","no-unused-expressions":"off","no-unused-vars":"off","node/prefer-global/process":"off","style/comma-dangle":"off","style/eol-last":"off","@typescript-eslint/consistent-type-imports":"off","@typescript-eslint/no-namespace":"off","@typescript-eslint/no-redeclare":"off","@typescript-eslint/no-require-imports":"off","@typescript-eslint/no-unused-vars":"off","@typescript-eslint/no-use-before-define":"off","@typescript-eslint/no-var-requires":"off","unicode-bom":"off","unused-imports/no-unused-imports":"off","unused-imports/no-unused-vars":"off","@typescript-eslint/await-thenable":"off","@typescript-eslint/dot-notation":"off","@typescript-eslint/no-floating-promises":"off","@typescript-eslint/no-for-in-array":"off","@typescript-eslint/no-implied-eval":"off","@typescript-eslint/no-misused-promises":"off","@typescript-eslint/no-throw-literal":"off","@typescript-eslint/no-unnecessary-type-assertion":"off","@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off","@typescript-eslint/no-unsafe-call":"off","@typescript-eslint/no-unsafe-member-access":"off","@typescript-eslint/no-unsafe-return":"off","@typescript-eslint/restrict-plus-operands":"off","@typescript-eslint/restrict-template-expressions":"off","@typescript-eslint/unbound-method":"off",...t}}]};async function U(){return[{name:"eslint:node",plugins:{n:await r(import("eslint-plugin-n"))},rules:{"n/handle-callback-err":["error","^(err|error)$"],"n/no-deprecated-api":"error","n/no-exports-assign":"error","n/no-new-require":"error","n/no-path-concat":"error","n/prefer-global/buffer":["error","never"],"n/prefer-global/process":["error","never"],"n/process-exit-as-throw":"error"}}]}async function N(){return[{name:"eslint:sort-package-json",files:["**/package.json"],rules:{"jsonc/sort-array-values":["error",{order:{type:"asc"},pathPattern:"^files$"}],"jsonc/sort-keys":["error",{order:["publisher","name","displayName","type","version","private","packageManager","description","author","license","funding","homepage","repository","bugs","keywords","categories","sideEffects","exports","main","module","unpkg","jsdelivr","types","typesVersions","bin","icon","files","engines","activationEvents","contributes","scripts","peerDependencies","peerDependenciesMeta","dependencies","optionalDependencies","devDependencies","pnpm","overrides","resolutions","husky","simple-git-hooks","lint-staged","eslintConfig"],pathPattern:"^$"},{order:{type:"asc"},pathPattern:"^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"},{order:{type:"asc"},pathPattern:"^(?:resolutions|overrides|pnpm.overrides)$"},{order:["types","import","require","default"],pathPattern:"^exports.*$"}]}}]}async function $(){return[{name:"eslint:sort-tsconfig",files:["**/tsconfig.json","**/tsconfig.*.json"],rules:{"jsonc/sort-keys":["error",{order:["extends","compilerOptions","references","files","include","exclude"],pathPattern:"^$"},{order:["incremental","composite","tsBuildInfoFile","disableSourceOfProjectReferenceRedirect","disableSolutionSearching","disableReferencedProjectLoad","target","jsx","jsxFactory","jsxFragmentFactory","jsxImportSource","lib","moduleDetection","noLib","reactNamespace","useDefineForClassFields","emitDecoratorMetadata","experimentalDecorators","baseUrl","rootDir","rootDirs","customConditions","module","moduleResolution","moduleSuffixes","noResolve","paths","resolveJsonModule","resolvePackageJsonExports","resolvePackageJsonImports","typeRoots","types","allowArbitraryExtensions","allowImportingTsExtensions","allowUmdGlobalAccess","allowJs","checkJs","maxNodeModuleJsDepth","strict","strictBindCallApply","strictFunctionTypes","strictNullChecks","strictPropertyInitialization","allowUnreachableCode","allowUnusedLabels","alwaysStrict","exactOptionalPropertyTypes","noFallthroughCasesInSwitch","noImplicitAny","noImplicitOverride","noImplicitReturns","noImplicitThis","noPropertyAccessFromIndexSignature","noUncheckedIndexedAccess","noUnusedLocals","noUnusedParameters","useUnknownInCatchVariables","declaration","declarationDir","declarationMap","downlevelIteration","emitBOM","emitDeclarationOnly","importHelpers","importsNotUsedAsValues","inlineSourceMap","inlineSources","mapRoot","newLine","noEmit","noEmitHelpers","noEmitOnError","outDir","outFile","preserveConstEnums","preserveValueImports","removeComments","sourceMap","sourceRoot","stripInternal","allowSyntheticDefaultImports","esModuleInterop","forceConsistentCasingInFileNames","isolatedModules","preserveSymlinks","verbatimModuleSyntax","skipDefaultLibCheck","skipLibCheck"],pathPattern:"^compilerOptions$"}]}}]}var ne=n(require("process"),1);var ve={"dot-notation":"off","no-implied-eval":"off","no-throw-literal":"off","@typescript-eslint/await-thenable":"error","@typescript-eslint/dot-notation":["error",{allowKeywords:!0}],"@typescript-eslint/no-floating-promises":"error","@typescript-eslint/no-for-in-array":"error","@typescript-eslint/no-implied-eval":"error","@typescript-eslint/no-misused-promises":"error","@typescript-eslint/no-throw-literal":"error","@typescript-eslint/no-unnecessary-type-assertion":"error","@typescript-eslint/no-unsafe-argument":"error","@typescript-eslint/no-unsafe-assignment":"error","@typescript-eslint/no-unsafe-call":"error","@typescript-eslint/no-unsafe-member-access":"error","@typescript-eslint/no-unsafe-return":"error","@typescript-eslint/restrict-plus-operands":"error","@typescript-eslint/restrict-template-expressions":"error","@typescript-eslint/unbound-method":"error"},V=async e=>{let{overrides:o={},componentExts:t=[],parserOptions:s={},tsconfigPath:i}=e??{},[l,m]=await Promise.all([r(import("@typescript-eslint/eslint-plugin")),r(import("@typescript-eslint/parser"))]);return[{name:"eslint:typescript:setup",plugins:{"@typescript-eslint":l}},{name:"eslint:typescript:rules",files:[d,...t.map(p=>`**/*.${p}`)],languageOptions:{parser:m,parserOptions:{extraFileExtensions:t.map(p=>`.${p}`),sourceType:"module",...i?{project:[i],tsconfigRootDir:ne.default.cwd()}:{},...s}},rules:{...l.configs["eslint-recommended"].overrides[0].rules,...l.configs.strict.rules,"no-dupe-class-members":"off","no-invalid-this":"off","no-loss-of-precision":"off","no-redeclare":"off","no-use-before-define":"off","no-useless-constructor":"off","@typescript-eslint/ban-ts-comment":["error",{"ts-ignore":"allow-with-description"}],"@typescript-eslint/ban-types":["error",{types:{Function:!1}}],"@typescript-eslint/consistent-type-definitions":["error","interface"],"@typescript-eslint/consistent-type-imports":["error",{disallowTypeAnnotations:!1,prefer:"type-imports"}],"@typescript-eslint/no-dupe-class-members":"error","@typescript-eslint/no-dynamic-delete":"off","@typescript-eslint/no-explicit-any":"off","@typescript-eslint/no-extraneous-class":"off","@typescript-eslint/no-import-type-side-effects":"error","@typescript-eslint/no-invalid-this":"error","@typescript-eslint/no-invalid-void-type":"off","@typescript-eslint/no-loss-of-precision":"error","@typescript-eslint/no-non-null-assertion":"off","@typescript-eslint/no-redeclare":"error","@typescript-eslint/no-require-imports":"error","@typescript-eslint/no-unused-vars":"off","@typescript-eslint/no-use-before-define":["error",{classes:!1,functions:!1,variables:!0}],"@typescript-eslint/no-useless-constructor":"off","@typescript-eslint/prefer-ts-expect-error":"error","@typescript-eslint/triple-slash-reference":"off","@typescript-eslint/unified-signatures":"off",...i?ve:{},...o}},{name:"eslint:typescript:dts-overrides",files:["**/*.d.ts"],rules:{"eslint-comments/no-unlimited-disable":"off","import/no-duplicates":"off","no-restricted-syntax":"off","unused-imports/no-unused-vars":"off"}},{name:"eslint:typescript:tests-overrides",files:["**/*.{test,spec}.ts?(x)"],rules:{"no-unused-expressions":"off"}},{files:["**/*.js","**/*.cjs"],name:"eslint:typescript:javascript-overrides",rules:{"@typescript-eslint/no-require-imports":"off","@typescript-eslint/no-var-requires":"off"}}]};async function W(){return[{name:"eslint:unicorn",plugins:{unicorn:await r(import("eslint-plugin-unicorn"))},rules:{"unicorn/error-message":"error","unicorn/escape-case":"error","unicorn/no-instanceof-array":"error","unicorn/no-new-array":"error","unicorn/no-new-buffer":"error","unicorn/number-literal-case":"error","unicorn/prefer-dom-node-text-content":"error","unicorn/prefer-includes":"error","unicorn/prefer-node-protocol":"error","unicorn/prefer-number-properties":"error","unicorn/prefer-string-starts-ends-with":"error","unicorn/prefer-type-error":"error","unicorn/throw-new-error":"error"}}]}var X=async(e={})=>{let{overrides:o={},typescript:t}=e,[s,i]=await Promise.all([r(import("eslint-plugin-vue")),r(import("vue-eslint-parser"))]);return[{name:"eslint:vue:setup",plugins:{vue:s}},{name:"eslint:vue:rules",files:[j],languageOptions:{parser:i,parserOptions:{ecmaFeatures:{jsx:!0},extraFileExtensions:[".vue"],parser:t?await r(import("@typescript-eslint/parser")):null,sourceType:"module"}},processor:s.processors[".vue"],rules:{...s.configs.base.rules,...s.configs["vue3-essential"].rules,...s.configs["vue3-strongly-recommended"].rules,...s.configs["vue3-recommended"].rules,"node/prefer-global/process":"off","vue/block-order":["error",{order:["script","template","style"]}],"vue/component-name-in-template-casing":["error","PascalCase",{registeredComponentsOnly:!1}],"vue/component-options-name-casing":["error","PascalCase"],"vue/custom-event-name-casing":["error","camelCase"],"vue/define-macros-order":["error",{order:["defineOptions","defineProps","defineEmits","defineSlots"]}],"vue/dot-location":["error","property"],"vue/dot-notation":["error",{allowKeywords:!0}],"vue/eqeqeq":["error","smart"],"vue/html-indent":["error",2],"vue/html-quotes":["error","double"],"vue/max-attributes-per-line":"off","vue/multi-word-component-names":"off","vue/no-dupe-keys":"off","vue/no-empty-pattern":"error","vue/no-extra-parens":["error","functions"],"vue/no-irregular-whitespace":"error","vue/no-loss-of-precision":"error","vue/no-restricted-syntax":["error","DebuggerStatement","LabeledStatement","WithStatement"],"vue/no-restricted-v-bind":["error","/^v-/"],"vue/no-setup-props-reactivity-loss":"off","vue/no-sparse-arrays":"error","vue/no-unused-refs":"error","vue/no-useless-v-bind":"error","vue/no-v-html":"off","vue/object-shorthand":["error","always",{avoidQuotes:!0,ignoreConstructors:!1}],"vue/prefer-separate-static-class":"error","vue/prefer-template":"error","vue/require-default-prop":"off","vue/require-prop-types":"off","vue/space-infix-ops":"error","vue/space-unary-ops":["error",{nonwords:!1,words:!0}],"vue/array-bracket-spacing":["error","never"],"vue/arrow-spacing":["error",{after:!0,before:!0}],"vue/block-spacing":["error","always"],"vue/block-tag-newline":["error",{multiline:"always",singleline:"always"}],"vue/brace-style":["error","stroustrup",{allowSingleLine:!0}],"vue/comma-dangle":["error","always-multiline"],"vue/comma-spacing":["error",{after:!0,before:!1}],"vue/comma-style":["error","last"],"vue/html-comment-content-spacing":["error","always",{exceptions:["-"]}],"vue/key-spacing":["error",{afterColon:!0,beforeColon:!1}],"vue/keyword-spacing":["error",{after:!0,before:!0}],"vue/object-curly-newline":"off","vue/object-curly-spacing":["error","always"],"vue/object-property-newline":["error",{allowMultiplePropertiesPerLine:!0}],"vue/operator-linebreak":["error","before"],"vue/padding-line-between-blocks":["error","always"],"vue/quote-props":["error","consistent-as-needed"],"vue/space-in-parens":["error","never"],"vue/template-curly-spacing":"error",...o}}]};var Y=async e=>{let{overrides:o={}}=e,[t,s]=await Promise.all([r(import("eslint-plugin-yml")),r(import("yaml-eslint-parser"))]);return[{name:"eslint:yaml:setup",plugins:{yml:t}},{name:"eslint:yaml:rules",files:[g],languageOptions:{parser:s},rules:{...t.configs.standard.rules,...t.configs.prettier.rules,"yml/block-mapping":"error","yml/block-sequence":"error","yml/no-empty-key":"error","yml/no-empty-sequence-entry":"error","yml/no-irregular-whitespace":"error","yml/plain-scalar":"error","yml/vue-custom-block/no-parsing-error":"error","yml/spaced-comment":"error",...o}}]};var H=async e=>{let{overrides:o={}}=e,[t,s]=await Promise.all([r(import("eslint-plugin-toml")),r(import("toml-eslint-parser"))]);return[{name:"eslint:toml:setup",plugins:{toml:t}},{name:"eslint:toml:rules",files:[x],languageOptions:{parser:s},rules:{"style/spaced-comment":"off","toml/comma-style":"error","toml/keys-order":"error","toml/no-space-dots":"error","toml/no-unreadable-number-separator":"error","toml/precision-of-fractional-seconds":"error","toml/precision-of-integer":"error","toml/tables-order":"error","toml/vue-custom-block/no-parsing-error":"error","toml/array-bracket-newline":"error","toml/array-bracket-spacing":"error","toml/array-element-newline":"error","toml/indent":["error",2],"toml/inline-table-curly-spacing":"error","toml/key-spacing":"error","toml/padding-line-between-pairs":"error","toml/padding-line-between-tables":"error","toml/quoted-keys":"error","toml/spaced-comment":"error","toml/table-bracket-spacing":"error",...o}}]};var K=async e=>{let{overrides:o={}}=e,[t,s]=await Promise.all([r(import("eslint-plugin-vitest")),r(import("eslint-plugin-no-only-tests"))]);return[{name:"eslint:test:setup",plugins:{test:{...t,rules:{...t.rules,...s.rules}}}},{name:"eslint:test:rules",files:B,rules:{"test/consistent-test-it":["error",{fn:"it",withinDescribe:"it"}],"test/no-identical-title":"error","test/no-only-tests":"error","test/prefer-hooks-in-order":"error","test/prefer-lowercase-title":"error",...o}}]};async function z(){return[{name:"eslint:perfectionist",plugins:{perfectionist:await r(import("eslint-plugin-perfectionist"))}}]}var Q=async e=>{let[o,t,s]=await Promise.all([r(import("eslint-plugin-prettier")),r(import("eslint-config-prettier")),r(import("eslint-parser-plain"))]),i=[{name:"eslint:prettier:markdown",files:[f],parser:"markdown"},{name:"eslint:prettier:mdx",files:[y],parser:"mdx"},{name:"eslint:prettier:html",files:["**/*.html"],parser:"html"},{name:"eslint:prettier:css",files:[T,_],parser:"css"},{name:"eslint:prettier:scss",files:[G],parser:"scss"},{name:"eslint:prettier:less",files:[L],parser:"less"},{name:"eslint:prettier:yaml",files:[g],parser:"yaml"},{name:"eslint:prettier:graphql",files:["**/*.graphql"],parser:"graphql"}].map(l=>({name:l.name,files:l.files,languageOptions:{parser:s},rules:{"prettier/prettier":["warn",{quoteProps:"consistent",parser:l.parser,...e}]}}));return[{name:"eslint:prettier:setup",plugins:{prettier:o}},{name:"eslint:prettier:rules",ignores:[x],rules:{...t.rules,...o.configs.recommended.rules,"prettier/prettier":["warn",{quoteProps:"consistent",...e}]}},...i]};async function Ce(){let e=await r(import("@next/eslint-plugin-next"));return[{name:"eslint:next:setup",plugins:{"@next/next":e}},{name:"eslint:next:rules",files:[w,C],languageOptions:{parserOptions:{sourceType:"module",ecmaFeatures:{jsx:!0}}},settings:{react:{version:"detect"}},rules:{...e.configs.recommended.rules,...e.configs["core-web-vitals"].rules}}]}var se=async e=>{let{next:o=!1,overrides:t={}}=e,[s,i]=await Promise.all([r(import("eslint-plugin-react")),r(import("eslint-plugin-react-hooks"))]),l=[{name:"eslint:react:setup",plugins:{react:s,"react-hooks":i}},{name:"eslint:react:rules",files:[w,C],languageOptions:{parserOptions:{sourceType:"module",ecmaFeatures:{jsx:!0}}},settings:{react:{version:"detect"}},rules:{...s.configs.recommended.rules,...i.configs.recommended.rules,"jsx-quotes":["error","prefer-double"],"react/react-in-jsx-scope":"off","react/jsx-indent":[1,2],"react/jsx-indent-props":[1,2],"react/jsx-closing-bracket-location":[1,{selfClosing:"tag-aligned",nonEmpty:"tag-aligned"}],...t}}];return b(l,o?Ce():[])};async function ie(){let e=await r(import("eslint-plugin-tailwindcss"));return[{name:"eslint:tailwindcss",plugins:{tailwindcss:e},rules:{...e.configs.recommended.rules}}]}function c(e){return e?typeof e!="boolean"?e:{}:{}}function Z(e={}){let{ignores:o=!0,vue:t,react:s,typescript:i,tailwindcss:l,componentExts:m=[]}=e,p=[];return p.push(F(c(o)),q(e.javascript??{}),P(),U(),M(),R(),W(),z()),t&&m.push("vue"),i&&p.push(V({...typeof i!="boolean"?i:{},componentExts:m})),(e.test??!0)&&p.push(K(c(e.test))),t&&p.push(X({...c(e.vue),typescript:!!i})),s&&p.push(se(c(s))),(e.jsonc??!0)&&p.push(A(c(e.jsonc)),N(),$()),(e.yml??!0)&&p.push(Y(c(e.yml))),(e.toml??!0)&&p.push(H(c(e.toml))),(e.markdown??!0)&&p.push(J({...c(e.markdown),componentExts:m})),l&&p.push(ie()),(e.prettier??!0)&&p.push(Q(c(e.prettier))),b(...p,e.customConfig??[])}var we=Z;0&&(module.exports={GLOB_ALL_SRC,GLOB_CSS,GLOB_EXCLUDE,GLOB_HTML,GLOB_JS,GLOB_JSON,GLOB_JSON5,GLOB_JSONC,GLOB_JSX,GLOB_LESS,GLOB_MARKDOWN,GLOB_MARKDOWN_CODE,GLOB_MDX,GLOB_POSTCSS,GLOB_SCSS,GLOB_SRC,GLOB_SRC_EXT,GLOB_STYLE,GLOB_TESTS,GLOB_TOML,GLOB_TS,GLOB_TSX,GLOB_VUE,GLOB_YAML,combine,comments,config,ignores,imports,interopDefault,javascript,jsdoc,jsonc,markdown,node,perfectionist,prettier,sortPackageJson,sortTsconfig,test,toml,typescript,unicorn,vue,yml});