@ivanmaxlogiudice/eslint-config 1.0.0-beta.9 → 1.0.6

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 ADDED
@@ -0,0 +1,1944 @@
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_DIST: () => GLOB_DIST,
36
+ GLOB_EXCLUDE: () => GLOB_EXCLUDE,
37
+ GLOB_HTML: () => GLOB_HTML,
38
+ GLOB_JS: () => GLOB_JS,
39
+ GLOB_JSON: () => GLOB_JSON,
40
+ GLOB_JSON5: () => GLOB_JSON5,
41
+ GLOB_JSONC: () => GLOB_JSONC,
42
+ GLOB_JSX: () => GLOB_JSX,
43
+ GLOB_LESS: () => GLOB_LESS,
44
+ GLOB_LOCKFILE: () => GLOB_LOCKFILE,
45
+ GLOB_MARKDOWN: () => GLOB_MARKDOWN,
46
+ GLOB_MARKDOWN_CODE: () => GLOB_MARKDOWN_CODE,
47
+ GLOB_NODE_MODULES: () => GLOB_NODE_MODULES,
48
+ GLOB_SCSS: () => GLOB_SCSS,
49
+ GLOB_SRC: () => GLOB_SRC,
50
+ GLOB_SRC_EXT: () => GLOB_SRC_EXT,
51
+ GLOB_STYLE: () => GLOB_STYLE,
52
+ GLOB_TESTS: () => GLOB_TESTS,
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
+ javascript: () => javascript,
64
+ jsdoc: () => jsdoc,
65
+ jsonc: () => jsonc,
66
+ markdown: () => markdown,
67
+ node: () => node,
68
+ parserJsonc: () => import_jsonc_eslint_parser.default,
69
+ parserTs: () => parserTs,
70
+ parserVue: () => import_vue_eslint_parser.default,
71
+ parserYaml: () => import_yaml_eslint_parser.default,
72
+ perfectionist: () => perfectionist,
73
+ pluginAntfu: () => import_eslint_plugin_antfu.default,
74
+ pluginComments: () => import_eslint_plugin_eslint_comments.default,
75
+ pluginImport: () => pluginImport,
76
+ pluginJsdoc: () => import_eslint_plugin_jsdoc.default,
77
+ pluginJsonc: () => pluginJsonc,
78
+ pluginMarkdown: () => import_eslint_plugin_markdown.default,
79
+ pluginNoOnlyTests: () => import_eslint_plugin_no_only_tests.default,
80
+ pluginNode: () => import_eslint_plugin_n.default,
81
+ pluginPerfectionist: () => import_eslint_plugin_perfectionist.default,
82
+ pluginPromise: () => import_eslint_plugin_promise.default,
83
+ pluginStylistic: () => import_eslint_plugin.default,
84
+ pluginTs: () => import_eslint_plugin2.default,
85
+ pluginUnicorn: () => import_eslint_plugin_unicorn.default,
86
+ pluginUnocss: () => import_eslint_plugin3.default,
87
+ pluginUnusedImports: () => import_eslint_plugin_unused_imports.default,
88
+ pluginVitest: () => import_eslint_plugin_vitest.default,
89
+ pluginVue: () => import_eslint_plugin_vue.default,
90
+ pluginYaml: () => pluginYaml,
91
+ renameRules: () => renameRules,
92
+ sortPackageJson: () => sortPackageJson,
93
+ sortTsconfig: () => sortTsconfig,
94
+ stylistic: () => stylistic,
95
+ test: () => test,
96
+ toArray: () => toArray,
97
+ typescript: () => typescript,
98
+ unicorn: () => unicorn,
99
+ unocss: () => unocss,
100
+ vue: () => vue,
101
+ yaml: () => yaml
102
+ });
103
+ module.exports = __toCommonJS(src_exports);
104
+
105
+ // src/factory.ts
106
+ var import_node_fs = __toESM(require("fs"), 1);
107
+ var import_node_process2 = __toESM(require("process"), 1);
108
+ var import_eslint_config_flat_gitignore = __toESM(require("eslint-config-flat-gitignore"), 1);
109
+ var import_local_pkg = require("local-pkg");
110
+
111
+ // src/plugins.ts
112
+ var import_eslint_plugin = __toESM(require("@stylistic/eslint-plugin"), 1);
113
+ var import_eslint_plugin2 = __toESM(require("@typescript-eslint/eslint-plugin"), 1);
114
+ var parserTs = __toESM(require("@typescript-eslint/parser"), 1);
115
+ var import_eslint_plugin3 = __toESM(require("@unocss/eslint-plugin"), 1);
116
+ var import_eslint_plugin_antfu = __toESM(require("eslint-plugin-antfu"), 1);
117
+ var import_eslint_plugin_eslint_comments = __toESM(require("eslint-plugin-eslint-comments"), 1);
118
+ var pluginImport = __toESM(require("eslint-plugin-i"), 1);
119
+ var import_eslint_plugin_jsdoc = __toESM(require("eslint-plugin-jsdoc"), 1);
120
+ var pluginJsonc = __toESM(require("eslint-plugin-jsonc"), 1);
121
+ var import_eslint_plugin_markdown = __toESM(require("eslint-plugin-markdown"), 1);
122
+ var import_eslint_plugin_n = __toESM(require("eslint-plugin-n"), 1);
123
+ var import_eslint_plugin_no_only_tests = __toESM(require("eslint-plugin-no-only-tests"), 1);
124
+ var import_eslint_plugin_perfectionist = __toESM(require("eslint-plugin-perfectionist"), 1);
125
+ var import_eslint_plugin_promise = __toESM(require("eslint-plugin-promise"), 1);
126
+ var import_eslint_plugin_unicorn = __toESM(require("eslint-plugin-unicorn"), 1);
127
+ var import_eslint_plugin_unused_imports = __toESM(require("eslint-plugin-unused-imports"), 1);
128
+ var import_eslint_plugin_vitest = __toESM(require("eslint-plugin-vitest"), 1);
129
+ var import_eslint_plugin_vue = __toESM(require("eslint-plugin-vue"), 1);
130
+ var pluginYaml = __toESM(require("eslint-plugin-yml"), 1);
131
+ var import_jsonc_eslint_parser = __toESM(require("jsonc-eslint-parser"), 1);
132
+ var import_vue_eslint_parser = __toESM(require("vue-eslint-parser"), 1);
133
+ var import_yaml_eslint_parser = __toESM(require("yaml-eslint-parser"), 1);
134
+
135
+ // src/configs/comments.ts
136
+ function comments() {
137
+ return [
138
+ {
139
+ name: "config:eslint-comments",
140
+ plugins: {
141
+ "eslint-comments": import_eslint_plugin_eslint_comments.default
142
+ },
143
+ rules: {
144
+ ...import_eslint_plugin_eslint_comments.default.configs.recommended.rules,
145
+ "eslint-comments/disable-enable-pair": ["error", {
146
+ allowWholeFile: true
147
+ }]
148
+ }
149
+ }
150
+ ];
151
+ }
152
+
153
+ // src/globs.ts
154
+ var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
155
+ var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
156
+ var GLOB_JS = "**/*.?([cm])js";
157
+ var GLOB_JSX = "**/*.?([cm])jsx";
158
+ var GLOB_TS = "**/*.?([cm])ts";
159
+ var GLOB_TSX = "**/*.?([cm])tsx";
160
+ var GLOB_STYLE = "**/*.{c,le,sc}ss";
161
+ var GLOB_CSS = "**/*.css";
162
+ var GLOB_LESS = "**/*.less";
163
+ var GLOB_SCSS = "**/*.scss";
164
+ var GLOB_JSON = "**/*.json";
165
+ var GLOB_JSON5 = "**/*.json5";
166
+ var GLOB_JSONC = "**/*.jsonc";
167
+ var GLOB_MARKDOWN = "**/*.md";
168
+ var GLOB_VUE = "**/*.vue";
169
+ var GLOB_YAML = "**/*.y?(a)ml";
170
+ var GLOB_HTML = "**/*.htm?(l)";
171
+ var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
172
+ var GLOB_TESTS = [
173
+ `**/__tests__/**/*.${GLOB_SRC_EXT}`,
174
+ `**/*.spec.${GLOB_SRC_EXT}`,
175
+ `**/*.test.${GLOB_SRC_EXT}`,
176
+ `**/*.bench.${GLOB_SRC_EXT}`,
177
+ `**/*.benchmark.${GLOB_SRC_EXT}`
178
+ ];
179
+ var GLOB_ALL_SRC = [
180
+ GLOB_SRC,
181
+ GLOB_STYLE,
182
+ GLOB_JSON,
183
+ GLOB_JSON5,
184
+ GLOB_MARKDOWN,
185
+ GLOB_VUE,
186
+ GLOB_YAML,
187
+ GLOB_HTML
188
+ ];
189
+ var GLOB_NODE_MODULES = "**/node_modules";
190
+ var GLOB_DIST = "**/dist";
191
+ var GLOB_LOCKFILE = [
192
+ "**/package-lock.json",
193
+ "**/yarn.lock",
194
+ "**/pnpm-lock.yaml",
195
+ "**/bun.lockb"
196
+ ];
197
+ var GLOB_EXCLUDE = [
198
+ GLOB_NODE_MODULES,
199
+ GLOB_DIST,
200
+ ...GLOB_LOCKFILE,
201
+ "**/output",
202
+ "**/coverage",
203
+ "**/temp",
204
+ "**/.temp",
205
+ "**/tmp",
206
+ "**/.tmp",
207
+ "**/.history",
208
+ "**/fixtures",
209
+ "**/.vitepress/cache",
210
+ "**/.nuxt",
211
+ "**/.next",
212
+ "**/.vercel",
213
+ "**/.changeset",
214
+ "**/.idea",
215
+ "**/.output",
216
+ "**/.vite-inspect",
217
+ "**/CHANGELOG*.md",
218
+ "**/*.min.*",
219
+ "**/LICENSE*",
220
+ "**/__snapshots__",
221
+ "**/auto-import?(s).d.ts",
222
+ "**/components.d.ts"
223
+ ];
224
+
225
+ // src/configs/ignores.ts
226
+ function ignores() {
227
+ return [
228
+ {
229
+ ignores: GLOB_EXCLUDE
230
+ }
231
+ ];
232
+ }
233
+
234
+ // src/configs/imports.ts
235
+ function imports(options = {}) {
236
+ const {
237
+ stylistic: stylistic2 = true
238
+ } = options;
239
+ return [
240
+ {
241
+ name: "config:imports",
242
+ plugins: {
243
+ antfu: import_eslint_plugin_antfu.default,
244
+ import: pluginImport
245
+ },
246
+ rules: {
247
+ "antfu/import-dedupe": "error",
248
+ "antfu/no-import-node-modules-by-path": "error",
249
+ "import/first": "error",
250
+ "import/no-duplicates": "error",
251
+ "import/no-mutable-exports": "error",
252
+ "import/no-named-default": "error",
253
+ "import/no-self-import": "error",
254
+ "import/no-webpack-loader-syntax": "error",
255
+ ...stylistic2 ? {
256
+ "import/newline-after-import": ["error", {
257
+ considerComments: true,
258
+ count: 1
259
+ }]
260
+ } : {}
261
+ }
262
+ }
263
+ ];
264
+ }
265
+
266
+ // src/configs/javascript.ts
267
+ var import_globals = __toESM(require("globals"), 1);
268
+ function javascript(options = {}) {
269
+ const {
270
+ isInEditor = false,
271
+ overrides = {}
272
+ } = options;
273
+ return [
274
+ {
275
+ languageOptions: {
276
+ ecmaVersion: 2022,
277
+ globals: {
278
+ ...import_globals.default.browser,
279
+ ...import_globals.default.es2021,
280
+ ...import_globals.default.node,
281
+ document: "readonly",
282
+ navigator: "readonly",
283
+ window: "readonly"
284
+ },
285
+ parserOptions: {
286
+ ecmaFeatures: {
287
+ jsx: true
288
+ },
289
+ ecmaVersion: 2022,
290
+ sourceType: "module"
291
+ },
292
+ sourceType: "module"
293
+ },
294
+ linterOptions: {
295
+ reportUnusedDisableDirectives: true
296
+ },
297
+ name: "config:javascript",
298
+ plugins: {
299
+ "antfu": import_eslint_plugin_antfu.default,
300
+ "promise": import_eslint_plugin_promise.default,
301
+ "unused-imports": import_eslint_plugin_unused_imports.default
302
+ },
303
+ rules: {
304
+ "accessor-pairs": ["error", {
305
+ enforceForClassMembers: true,
306
+ setWithoutGet: true
307
+ }],
308
+ "array-callback-return": "error",
309
+ "block-scoped-var": "error",
310
+ "consistent-return": "error",
311
+ "constructor-super": "error",
312
+ "default-case-last": "error",
313
+ "dot-notation": ["error", {
314
+ allowKeywords: true
315
+ }],
316
+ "eqeqeq": ["error", "smart"],
317
+ "new-cap": ["error", {
318
+ capIsNew: false,
319
+ newIsCap: true,
320
+ properties: true
321
+ }],
322
+ "no-alert": "error",
323
+ "no-array-constructor": "error",
324
+ "no-async-promise-executor": "error",
325
+ "no-caller": "error",
326
+ "no-case-declarations": "error",
327
+ "no-class-assign": "error",
328
+ "no-compare-neg-zero": "error",
329
+ "no-cond-assign": ["error", "always"],
330
+ "no-console": ["error", {
331
+ allow: ["warn", "error"]
332
+ }],
333
+ "no-const-assign": "error",
334
+ "no-control-regex": "error",
335
+ "no-debugger": "error",
336
+ "no-delete-var": "error",
337
+ "no-dupe-args": "error",
338
+ "no-dupe-class-members": "error",
339
+ "no-dupe-keys": "error",
340
+ "no-duplicate-case": "error",
341
+ "no-empty": ["error", {
342
+ allowEmptyCatch: true
343
+ }],
344
+ "no-empty-character-class": "error",
345
+ "no-empty-pattern": "error",
346
+ "no-eval": "error",
347
+ "no-ex-assign": "error",
348
+ "no-extend-native": "error",
349
+ "no-extra-bind": "error",
350
+ "no-extra-boolean-cast": "error",
351
+ "no-fallthrough": "error",
352
+ "no-func-assign": "error",
353
+ "no-global-assign": "error",
354
+ "no-implied-eval": "error",
355
+ "no-import-assign": "error",
356
+ "no-invalid-regexp": "error",
357
+ "no-invalid-this": "error",
358
+ "no-irregular-whitespace": "error",
359
+ "no-iterator": "error",
360
+ "no-labels": ["error", {
361
+ allowLoop: false,
362
+ allowSwitch: false
363
+ }],
364
+ "no-lone-blocks": "error",
365
+ "no-loss-of-precision": "error",
366
+ "no-misleading-character-class": "error",
367
+ "no-multi-str": "error",
368
+ "no-new": "error",
369
+ "no-new-func": "error",
370
+ "no-new-object": "error",
371
+ "no-new-symbol": "error",
372
+ "no-new-wrappers": "error",
373
+ "no-obj-calls": "error",
374
+ "no-octal": "error",
375
+ "no-octal-escape": "error",
376
+ "no-proto": "error",
377
+ "no-prototype-builtins": "error",
378
+ "no-redeclare": ["error", {
379
+ builtinGlobals: false
380
+ }],
381
+ "no-regex-spaces": "error",
382
+ "no-restricted-globals": [
383
+ "error",
384
+ { message: "Use `globalThis` instead.", name: "global" },
385
+ { message: "Use `globalThis` instead.", name: "self" }
386
+ ],
387
+ "no-restricted-properties": [
388
+ "error",
389
+ { message: "Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.", property: "__proto__" },
390
+ { message: "Use `Object.defineProperty` instead.", property: "__defineGetter__" },
391
+ { message: "Use `Object.defineProperty` instead.", property: "__defineSetter__" },
392
+ { message: "Use `Object.getOwnPropertyDescriptor` instead.", property: "__lookupGetter__" },
393
+ { message: "Use `Object.getOwnPropertyDescriptor` instead.", property: "__lookupSetter__" }
394
+ ],
395
+ "no-restricted-syntax": [
396
+ "error",
397
+ "DebuggerStatement",
398
+ "LabeledStatement",
399
+ "WithStatement",
400
+ "TSEnumDeclaration[const=true]",
401
+ "TSExportAssignment"
402
+ ],
403
+ "no-return-assign": ["error", "except-parens"],
404
+ "no-self-assign": ["error", {
405
+ props: true
406
+ }],
407
+ "no-self-compare": "error",
408
+ "no-sequences": "error",
409
+ "no-shadow-restricted-names": "error",
410
+ "no-sparse-arrays": "error",
411
+ "no-template-curly-in-string": "error",
412
+ "no-this-before-super": "error",
413
+ "no-throw-literal": "error",
414
+ "no-undef": "error",
415
+ "no-undef-init": "error",
416
+ "no-unexpected-multiline": "error",
417
+ "no-unmodified-loop-condition": "error",
418
+ "no-unneeded-ternary": ["error", {
419
+ defaultAssignment: false
420
+ }],
421
+ "no-unreachable": "error",
422
+ "no-unreachable-loop": "error",
423
+ "no-unsafe-finally": "error",
424
+ "no-unsafe-negation": "error",
425
+ "no-unused-expressions": ["error", {
426
+ allowShortCircuit: true,
427
+ allowTaggedTemplates: true,
428
+ allowTernary: true
429
+ }],
430
+ "no-unused-vars": ["error", {
431
+ args: "none",
432
+ caughtErrors: "none",
433
+ ignoreRestSiblings: true,
434
+ vars: "all"
435
+ }],
436
+ "no-use-before-define": ["error", {
437
+ classes: false,
438
+ functions: false,
439
+ variables: true
440
+ }],
441
+ "no-useless-backreference": "error",
442
+ "no-useless-call": "error",
443
+ "no-useless-catch": "error",
444
+ "no-useless-computed-key": "error",
445
+ "no-useless-constructor": "error",
446
+ "no-useless-rename": "error",
447
+ "no-useless-return": "error",
448
+ "no-var": "error",
449
+ "no-with": "error",
450
+ "object-shorthand": ["error", "always", {
451
+ avoidQuotes: true,
452
+ ignoreConstructors: false
453
+ }],
454
+ "one-var": ["error", {
455
+ initialized: "never"
456
+ }],
457
+ "prefer-arrow-callback": ["error", {
458
+ allowNamedFunctions: false,
459
+ allowUnboundThis: true
460
+ }],
461
+ "prefer-const": ["error", {
462
+ destructuring: "all",
463
+ ignoreReadBeforeAssign: true
464
+ }],
465
+ "prefer-exponentiation-operator": "error",
466
+ "prefer-promise-reject-errors": "error",
467
+ "prefer-regex-literals": ["error", {
468
+ disallowRedundantWrapping: true
469
+ }],
470
+ "prefer-rest-params": "error",
471
+ "prefer-spread": "error",
472
+ "prefer-template": "error",
473
+ "require-await": "error",
474
+ "symbol-description": "error",
475
+ "unicode-bom": ["error", "never"],
476
+ "unused-imports/no-unused-imports": isInEditor ? "off" : "error",
477
+ "unused-imports/no-unused-vars": ["error", {
478
+ args: "after-used",
479
+ argsIgnorePattern: "^_",
480
+ vars: "all",
481
+ varsIgnorePattern: "^_"
482
+ }],
483
+ "use-isnan": ["error", {
484
+ enforceForIndexOf: true,
485
+ enforceForSwitchCase: true
486
+ }],
487
+ "valid-typeof": ["error", {
488
+ requireStringLiterals: true
489
+ }],
490
+ "vars-on-top": "error",
491
+ "yoda": ["error", "never"],
492
+ // Promise
493
+ ...import_eslint_plugin_promise.default.configs.recommended.rules,
494
+ "promise/always-return": ["error", {
495
+ ignoreLastCallback: true
496
+ }],
497
+ ...overrides
498
+ }
499
+ },
500
+ {
501
+ files: [`scripts/${GLOB_SRC}`, `cli.${GLOB_SRC_EXT}`],
502
+ name: "config:scripts-overrides",
503
+ rules: {
504
+ "no-console": "off"
505
+ }
506
+ }
507
+ ];
508
+ }
509
+
510
+ // src/configs/jsdoc.ts
511
+ function jsdoc(options = {}) {
512
+ const {
513
+ stylistic: stylistic2 = true
514
+ } = options;
515
+ return [
516
+ {
517
+ name: "config:jsdoc",
518
+ plugins: {
519
+ jsdoc: import_eslint_plugin_jsdoc.default
520
+ },
521
+ rules: {
522
+ "jsdoc/check-access": "warn",
523
+ "jsdoc/check-param-names": "warn",
524
+ "jsdoc/check-property-names": "warn",
525
+ "jsdoc/check-types": "warn",
526
+ "jsdoc/empty-tags": "warn",
527
+ "jsdoc/implements-on-classes": "warn",
528
+ "jsdoc/no-defaults": "warn",
529
+ "jsdoc/no-multi-asterisks": "warn",
530
+ "jsdoc/require-param-name": "warn",
531
+ "jsdoc/require-property": "warn",
532
+ "jsdoc/require-property-description": "warn",
533
+ "jsdoc/require-property-name": "warn",
534
+ "jsdoc/require-returns-check": "warn",
535
+ "jsdoc/require-returns-description": "warn",
536
+ "jsdoc/require-yields-check": "warn",
537
+ ...stylistic2 ? {
538
+ "jsdoc/check-alignment": "warn",
539
+ "jsdoc/multiline-blocks": "warn"
540
+ } : {}
541
+ }
542
+ }
543
+ ];
544
+ }
545
+
546
+ // src/configs/jsonc.ts
547
+ function jsonc(options = {}) {
548
+ const {
549
+ overrides = {},
550
+ stylistic: stylistic2 = true
551
+ } = options;
552
+ const {
553
+ indent = 4
554
+ } = typeof stylistic2 === "boolean" ? {} : stylistic2;
555
+ return [
556
+ {
557
+ name: "config:jsonc:setup",
558
+ plugins: {
559
+ jsonc: pluginJsonc
560
+ }
561
+ },
562
+ {
563
+ files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
564
+ languageOptions: {
565
+ parser: import_jsonc_eslint_parser.default
566
+ },
567
+ name: "config:jsonc:rules",
568
+ rules: {
569
+ "jsonc/no-bigint-literals": "error",
570
+ "jsonc/no-binary-expression": "error",
571
+ "jsonc/no-binary-numeric-literals": "error",
572
+ "jsonc/no-dupe-keys": "error",
573
+ "jsonc/no-escape-sequence-in-identifier": "error",
574
+ "jsonc/no-floating-decimal": "error",
575
+ "jsonc/no-hexadecimal-numeric-literals": "error",
576
+ "jsonc/no-infinity": "error",
577
+ "jsonc/no-multi-str": "error",
578
+ "jsonc/no-nan": "error",
579
+ "jsonc/no-number-props": "error",
580
+ "jsonc/no-numeric-separators": "error",
581
+ "jsonc/no-octal": "error",
582
+ "jsonc/no-octal-escape": "error",
583
+ "jsonc/no-octal-numeric-literals": "error",
584
+ "jsonc/no-parenthesized": "error",
585
+ "jsonc/no-plus-sign": "error",
586
+ "jsonc/no-regexp-literals": "error",
587
+ "jsonc/no-sparse-arrays": "error",
588
+ "jsonc/no-template-literals": "error",
589
+ "jsonc/no-undefined-value": "error",
590
+ "jsonc/no-unicode-codepoint-escapes": "error",
591
+ "jsonc/no-useless-escape": "error",
592
+ "jsonc/space-unary-ops": "error",
593
+ "jsonc/valid-json-number": "error",
594
+ "jsonc/vue-custom-block/no-parsing-error": "error",
595
+ ...stylistic2 ? {
596
+ "jsonc/array-bracket-spacing": ["error", "never"],
597
+ "jsonc/comma-dangle": ["error", "never"],
598
+ "jsonc/comma-style": ["error", "last"],
599
+ "jsonc/indent": ["error", indent],
600
+ "jsonc/key-spacing": ["error", {
601
+ afterColon: true,
602
+ beforeColon: false
603
+ }],
604
+ "jsonc/object-curly-newline": ["error", {
605
+ consistent: true,
606
+ multiline: true
607
+ }],
608
+ "jsonc/object-curly-spacing": ["error", "always"],
609
+ "jsonc/object-property-newline": ["error", {
610
+ allowMultiplePropertiesPerLine: true
611
+ }],
612
+ "jsonc/quote-props": "error",
613
+ "jsonc/quotes": "error"
614
+ } : {},
615
+ ...overrides
616
+ }
617
+ }
618
+ ];
619
+ }
620
+
621
+ // src/configs/markdown.ts
622
+ function markdown(options = {}) {
623
+ const {
624
+ componentExts = [],
625
+ overrides = {}
626
+ } = options;
627
+ return [
628
+ {
629
+ name: "config:markdown:setup",
630
+ plugins: {
631
+ markdown: import_eslint_plugin_markdown.default
632
+ }
633
+ },
634
+ {
635
+ files: [GLOB_MARKDOWN],
636
+ name: "config:markdown:processor",
637
+ processor: "markdown/markdown"
638
+ },
639
+ {
640
+ files: [
641
+ GLOB_MARKDOWN_CODE,
642
+ ...componentExts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)
643
+ ],
644
+ languageOptions: {
645
+ parserOptions: {
646
+ ecmaFeatures: {
647
+ impliedStrict: true
648
+ }
649
+ }
650
+ },
651
+ name: "config:markdown:rules",
652
+ rules: {
653
+ ...import_eslint_plugin_markdown.default.configs.recommended.overrides[1].rules,
654
+ "antfu/no-ts-export-equal": "off",
655
+ "import/newline-after-import": "off",
656
+ "no-alert": "off",
657
+ "no-console": "off",
658
+ "no-labels": "off",
659
+ "no-lone-blocks": "off",
660
+ "no-restricted-syntax": "off",
661
+ "no-undef": "off",
662
+ "no-unused-expressions": "off",
663
+ "no-unused-labels": "off",
664
+ "no-unused-vars": "off",
665
+ "node/prefer-global/process": "off",
666
+ "style/comma-dangle": "off",
667
+ "style/eol-last": "off",
668
+ "ts/consistent-type-imports": "off",
669
+ "ts/no-namespace": "off",
670
+ "ts/no-redeclare": "off",
671
+ "ts/no-require-imports": "off",
672
+ "ts/no-unused-vars": "off",
673
+ "ts/no-use-before-define": "off",
674
+ "ts/no-var-requires": "off",
675
+ "unicode-bom": "off",
676
+ "unused-imports/no-unused-imports": "off",
677
+ "unused-imports/no-unused-vars": "off",
678
+ // Type aware rules
679
+ ...{
680
+ "ts/await-thenable": "off",
681
+ "ts/dot-notation": "off",
682
+ "ts/no-floating-promises": "off",
683
+ "ts/no-for-in-array": "off",
684
+ "ts/no-implied-eval": "off",
685
+ "ts/no-misused-promises": "off",
686
+ "ts/no-throw-literal": "off",
687
+ "ts/no-unnecessary-type-assertion": "off",
688
+ "ts/no-unsafe-argument": "off",
689
+ "ts/no-unsafe-assignment": "off",
690
+ "ts/no-unsafe-call": "off",
691
+ "ts/no-unsafe-member-access": "off",
692
+ "ts/no-unsafe-return": "off",
693
+ "ts/restrict-plus-operands": "off",
694
+ "ts/restrict-template-expressions": "off",
695
+ "ts/unbound-method": "off"
696
+ },
697
+ ...overrides
698
+ }
699
+ }
700
+ ];
701
+ }
702
+
703
+ // src/configs/node.ts
704
+ function node() {
705
+ return [
706
+ {
707
+ name: "config:node",
708
+ plugins: {
709
+ node: import_eslint_plugin_n.default
710
+ },
711
+ rules: {
712
+ "node/handle-callback-err": ["error", "^(err|error)$"],
713
+ "node/no-deprecated-api": "error",
714
+ "node/no-exports-assign": "error",
715
+ "node/no-new-require": "error",
716
+ "node/no-path-concat": "error",
717
+ "node/prefer-global/buffer": ["error", "never"],
718
+ "node/prefer-global/process": ["error", "never"],
719
+ "node/process-exit-as-throw": "error"
720
+ }
721
+ }
722
+ ];
723
+ }
724
+
725
+ // src/configs/perfectionist.ts
726
+ function perfectionist(options = {}) {
727
+ const {
728
+ overrides = {}
729
+ } = options;
730
+ return [
731
+ {
732
+ name: "config:perfectionist:setup",
733
+ plugins: {
734
+ perfectionist: import_eslint_plugin_perfectionist.default
735
+ }
736
+ },
737
+ {
738
+ name: "config:perfectionist:rules",
739
+ rules: {
740
+ "perfectionist/sort-classes": ["error", {
741
+ groups: [
742
+ "index-signature",
743
+ "static-property",
744
+ "private-property",
745
+ "property",
746
+ "constructor",
747
+ "static-method",
748
+ "private-method",
749
+ "method",
750
+ ["get-method", "set-method"],
751
+ "unknown"
752
+ ],
753
+ order: "asc",
754
+ type: "natural"
755
+ }],
756
+ "perfectionist/sort-exports": ["error", {
757
+ order: "asc",
758
+ type: "natural"
759
+ }],
760
+ "perfectionist/sort-imports": ["error", {
761
+ "groups": [
762
+ "builtin",
763
+ "external",
764
+ "internal-type",
765
+ "internal",
766
+ ["parent-type", "sibling-type", "index-type"],
767
+ ["parent", "sibling", "index"],
768
+ "object",
769
+ "type",
770
+ "unknown"
771
+ ],
772
+ "internal-pattern": ["{{@,~}/,#}**"],
773
+ "newlines-between": "never",
774
+ "order": "asc",
775
+ "type": "natural"
776
+ }],
777
+ "perfectionist/sort-named-exports": ["error", {
778
+ order: "asc",
779
+ type: "natural"
780
+ }],
781
+ "perfectionist/sort-named-imports": ["error", {
782
+ order: "asc",
783
+ type: "natural"
784
+ }],
785
+ // 'perfectionist/sort-array-includes': ['error', {
786
+ // 'order': 'asc',
787
+ // 'spread-last': true,
788
+ // 'type': 'natural',
789
+ // }],
790
+ // 'perfectionist/sort-astro-attributes': ['error', {
791
+ // order: 'asc',
792
+ // type: 'natural',
793
+ // }],
794
+ // 'perfectionist/sort-enums': ['error', {
795
+ // order: 'asc',
796
+ // type: 'natural',
797
+ // }],
798
+ // 'perfectionist/sort-interfaces': ['error', {
799
+ // order: 'asc',
800
+ // type: 'natural',
801
+ // }],
802
+ // 'perfectionist/sort-jsx-props': ['error', {
803
+ // order: 'asc',
804
+ // type: 'natural',
805
+ // }],
806
+ // 'perfectionist/sort-maps': ['error', {
807
+ // order: 'asc',
808
+ // type: 'natural',
809
+ // }],
810
+ //
811
+ // 'perfectionist/sort-object-types': ['error', {
812
+ // order: 'asc',
813
+ // type: 'natural',
814
+ // }],
815
+ // 'perfectionist/sort-objects': ['error', {
816
+ // 'order': 'asc',
817
+ // 'partition-by-comment': true,
818
+ // 'type': 'natural',
819
+ // }],
820
+ // 'perfectionist/sort-svelte-attributes': ['error', {
821
+ // order: 'asc',
822
+ // type: 'natural',
823
+ // }],
824
+ // 'perfectionist/sort-union-types': ['error', {
825
+ // order: 'asc',
826
+ // type: 'natural',
827
+ // }],
828
+ ...overrides
829
+ }
830
+ }
831
+ ];
832
+ }
833
+
834
+ // src/configs/sort.ts
835
+ function sortPackageJson() {
836
+ return [
837
+ {
838
+ files: ["**/package.json"],
839
+ name: "config:sort-package-json",
840
+ rules: {
841
+ "jsonc/sort-array-values": ["error", {
842
+ order: { type: "asc" },
843
+ pathPattern: "^files$"
844
+ }],
845
+ "jsonc/sort-keys": [
846
+ "error",
847
+ {
848
+ order: [
849
+ "name",
850
+ "version",
851
+ "private",
852
+ "packageManager",
853
+ "description",
854
+ "type",
855
+ "keywords",
856
+ "license",
857
+ "homepage",
858
+ "bugs",
859
+ "repository",
860
+ "author",
861
+ "contributors",
862
+ "funding",
863
+ "files",
864
+ "main",
865
+ "module",
866
+ "types",
867
+ "exports",
868
+ "typesVersions",
869
+ "sideEffects",
870
+ "unpkg",
871
+ "jsdelivr",
872
+ "browser",
873
+ "bin",
874
+ "man",
875
+ "directories",
876
+ "publishConfig",
877
+ "scripts",
878
+ "peerDependencies",
879
+ "peerDependenciesMeta",
880
+ "optionalDependencies",
881
+ "dependencies",
882
+ "devDependencies",
883
+ "engines",
884
+ "config",
885
+ "overrides",
886
+ "pnpm",
887
+ "husky",
888
+ "simple-git-hooks",
889
+ "lint-staged",
890
+ "eslintConfig"
891
+ ],
892
+ pathPattern: "^$"
893
+ },
894
+ {
895
+ order: { type: "asc" },
896
+ pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies$"
897
+ },
898
+ {
899
+ order: { type: "asc" },
900
+ pathPattern: "^resolutions$"
901
+ },
902
+ {
903
+ order: { type: "asc" },
904
+ pathPattern: "^pnpm.overrides$"
905
+ },
906
+ {
907
+ order: [
908
+ "types",
909
+ "import",
910
+ "require",
911
+ "default"
912
+ ],
913
+ pathPattern: "^exports.*$"
914
+ }
915
+ ]
916
+ }
917
+ }
918
+ ];
919
+ }
920
+ function sortTsconfig() {
921
+ return [
922
+ {
923
+ files: ["**/tsconfig.json", "**/tsconfig.*.json"],
924
+ name: "config:sort-tsconfig",
925
+ rules: {
926
+ "jsonc/sort-keys": [
927
+ "error",
928
+ {
929
+ order: [
930
+ "extends",
931
+ "compilerOptions",
932
+ "references",
933
+ "files",
934
+ "include",
935
+ "exclude"
936
+ ],
937
+ pathPattern: "^$"
938
+ },
939
+ {
940
+ order: [
941
+ /* Projects */
942
+ "incremental",
943
+ "composite",
944
+ "tsBuildInfoFile",
945
+ "disableSourceOfProjectReferenceRedirect",
946
+ "disableSolutionSearching",
947
+ "disableReferencedProjectLoad",
948
+ /* Language and Environment */
949
+ "target",
950
+ "jsx",
951
+ "jsxFactory",
952
+ "jsxFragmentFactory",
953
+ "jsxImportSource",
954
+ "lib",
955
+ "moduleDetection",
956
+ "noLib",
957
+ "reactNamespace",
958
+ "useDefineForClassFields",
959
+ "emitDecoratorMetadata",
960
+ "experimentalDecorators",
961
+ /* Modules */
962
+ "baseUrl",
963
+ "rootDir",
964
+ "rootDirs",
965
+ "customConditions",
966
+ "module",
967
+ "moduleResolution",
968
+ "moduleSuffixes",
969
+ "noResolve",
970
+ "paths",
971
+ "resolveJsonModule",
972
+ "resolvePackageJsonExports",
973
+ "resolvePackageJsonImports",
974
+ "typeRoots",
975
+ "types",
976
+ "allowArbitraryExtensions",
977
+ "allowImportingTsExtensions",
978
+ "allowUmdGlobalAccess",
979
+ /* JavaScript Support */
980
+ "allowJs",
981
+ "checkJs",
982
+ "maxNodeModuleJsDepth",
983
+ /* Type Checking */
984
+ "strict",
985
+ "strictBindCallApply",
986
+ "strictFunctionTypes",
987
+ "strictNullChecks",
988
+ "strictPropertyInitialization",
989
+ "allowUnreachableCode",
990
+ "allowUnusedLabels",
991
+ "alwaysStrict",
992
+ "exactOptionalPropertyTypes",
993
+ "noFallthroughCasesInSwitch",
994
+ "noImplicitAny",
995
+ "noImplicitOverride",
996
+ "noImplicitReturns",
997
+ "noImplicitThis",
998
+ "noPropertyAccessFromIndexSignature",
999
+ "noUncheckedIndexedAccess",
1000
+ "noUnusedLocals",
1001
+ "noUnusedParameters",
1002
+ "useUnknownInCatchVariables",
1003
+ /* Emit */
1004
+ "declaration",
1005
+ "declarationDir",
1006
+ "declarationMap",
1007
+ "downlevelIteration",
1008
+ "emitBOM",
1009
+ "emitDeclarationOnly",
1010
+ "importHelpers",
1011
+ "importsNotUsedAsValues",
1012
+ "inlineSourceMap",
1013
+ "inlineSources",
1014
+ "mapRoot",
1015
+ "newLine",
1016
+ "noEmit",
1017
+ "noEmitHelpers",
1018
+ "noEmitOnError",
1019
+ "outDir",
1020
+ "outFile",
1021
+ "preserveConstEnums",
1022
+ "preserveValueImports",
1023
+ "removeComments",
1024
+ "sourceMap",
1025
+ "sourceRoot",
1026
+ "stripInternal",
1027
+ /* Interop Constraints */
1028
+ "allowSyntheticDefaultImports",
1029
+ "esModuleInterop",
1030
+ "forceConsistentCasingInFileNames",
1031
+ "isolatedModules",
1032
+ "preserveSymlinks",
1033
+ "verbatimModuleSyntax",
1034
+ /* Completeness */
1035
+ "skipDefaultLibCheck",
1036
+ "skipLibCheck"
1037
+ ],
1038
+ pathPattern: "^compilerOptions$"
1039
+ }
1040
+ ]
1041
+ }
1042
+ }
1043
+ ];
1044
+ }
1045
+
1046
+ // src/configs/stylistic.ts
1047
+ function stylistic(options) {
1048
+ const {
1049
+ indent = 4,
1050
+ jsx = true,
1051
+ quotes = "single"
1052
+ } = options;
1053
+ return [
1054
+ {
1055
+ name: "config:stylistic",
1056
+ plugins: {
1057
+ antfu: import_eslint_plugin_antfu.default,
1058
+ style: import_eslint_plugin.default
1059
+ },
1060
+ rules: {
1061
+ "antfu/consistent-list-newline": "error",
1062
+ "antfu/if-newline": "error",
1063
+ "antfu/top-level-function": "error",
1064
+ "curly": ["error", "multi-or-nest", "consistent"],
1065
+ "style/array-bracket-spacing": ["error", "never"],
1066
+ "style/arrow-parens": ["error", "as-needed", {
1067
+ requireForBlockBody: true
1068
+ }],
1069
+ "style/arrow-spacing": ["error", {
1070
+ after: true,
1071
+ before: true
1072
+ }],
1073
+ "style/block-spacing": ["error", "always"],
1074
+ "style/brace-style": ["error", "stroustrup", {
1075
+ allowSingleLine: true
1076
+ }],
1077
+ "style/comma-dangle": ["error", "always-multiline"],
1078
+ "style/comma-spacing": ["error", {
1079
+ after: true,
1080
+ before: false
1081
+ }],
1082
+ "style/comma-style": ["error", "last"],
1083
+ "style/computed-property-spacing": ["error", "never", {
1084
+ enforceForClassMembers: true
1085
+ }],
1086
+ "style/dot-location": ["error", "property"],
1087
+ "style/eol-last": "error",
1088
+ "style/func-call-spacing": ["error", "never"],
1089
+ "style/indent": ["error", indent, {
1090
+ ArrayExpression: 1,
1091
+ CallExpression: { arguments: 1 },
1092
+ FunctionDeclaration: { body: 1, parameters: 1 },
1093
+ FunctionExpression: { body: 1, parameters: 1 },
1094
+ ImportDeclaration: 1,
1095
+ MemberExpression: 1,
1096
+ ObjectExpression: 1,
1097
+ SwitchCase: 1,
1098
+ VariableDeclarator: 1,
1099
+ flatTernaryExpressions: false,
1100
+ ignoreComments: false,
1101
+ ignoredNodes: [
1102
+ "TemplateLiteral *",
1103
+ "JSXElement",
1104
+ "JSXElement > *",
1105
+ "JSXAttribute",
1106
+ "JSXIdentifier",
1107
+ "JSXNamespacedName",
1108
+ "JSXMemberExpression",
1109
+ "JSXSpreadAttribute",
1110
+ "JSXExpressionContainer",
1111
+ "JSXOpeningElement",
1112
+ "JSXClosingElement",
1113
+ "JSXFragment",
1114
+ "JSXOpeningFragment",
1115
+ "JSXClosingFragment",
1116
+ "JSXText",
1117
+ "JSXEmptyExpression",
1118
+ "JSXSpreadChild",
1119
+ "TSTypeParameterInstantiation",
1120
+ "FunctionExpression > .params[decorators.length > 0]",
1121
+ "FunctionExpression > .params > :matches(Decorator, :not(:first-child))",
1122
+ "ClassBody.body > PropertyDefinition[decorators.length > 0] > .key"
1123
+ ],
1124
+ offsetTernaryExpressions: true,
1125
+ outerIIFEBody: 1
1126
+ }],
1127
+ "style/key-spacing": ["error", {
1128
+ afterColon: true,
1129
+ beforeColon: false
1130
+ }],
1131
+ "style/keyword-spacing": ["error", {
1132
+ after: true,
1133
+ before: true
1134
+ }],
1135
+ "style/lines-between-class-members": ["error", "always", {
1136
+ exceptAfterSingleLine: true
1137
+ }],
1138
+ "style/max-statements-per-line": ["error", {
1139
+ max: 1
1140
+ }],
1141
+ "style/member-delimiter-style": ["error", {
1142
+ multiline: {
1143
+ delimiter: "none"
1144
+ }
1145
+ }],
1146
+ "style/multiline-ternary": ["error", "always-multiline"],
1147
+ "style/new-parens": "error",
1148
+ "style/no-extra-parens": ["error", "functions"],
1149
+ "style/no-floating-decimal": "error",
1150
+ "style/no-mixed-operators": ["error", {
1151
+ allowSamePrecedence: true,
1152
+ groups: [
1153
+ ["==", "!=", "===", "!==", ">", ">=", "<", "<="],
1154
+ ["&&", "||"],
1155
+ ["in", "instanceof"]
1156
+ ]
1157
+ }],
1158
+ "style/no-mixed-spaces-and-tabs": "error",
1159
+ "style/no-multi-spaces": "error",
1160
+ "style/no-multiple-empty-lines": ["error", {
1161
+ max: 1,
1162
+ maxBOF: 0,
1163
+ maxEOF: 0
1164
+ }],
1165
+ "style/no-tabs": indent === "tab" ? "off" : "error",
1166
+ "style/no-trailing-spaces": "error",
1167
+ "style/no-whitespace-before-property": "error",
1168
+ "style/object-curly-newline": ["error", {
1169
+ consistent: true,
1170
+ multiline: true
1171
+ }],
1172
+ "style/object-curly-spacing": ["error", "always"],
1173
+ "style/object-property-newline": ["error", {
1174
+ allowMultiplePropertiesPerLine: true
1175
+ }],
1176
+ "style/operator-linebreak": ["error", "before"],
1177
+ "style/padded-blocks": ["error", {
1178
+ blocks: "never",
1179
+ classes: "never",
1180
+ switches: "never"
1181
+ }],
1182
+ "style/quote-props": ["error", "consistent-as-needed"],
1183
+ "style/quotes": ["error", quotes, {
1184
+ allowTemplateLiterals: true,
1185
+ avoidEscape: true
1186
+ }],
1187
+ "style/rest-spread-spacing": ["error", "never"],
1188
+ "style/semi": ["error", "never"],
1189
+ "style/semi-spacing": ["error", {
1190
+ after: true,
1191
+ before: false
1192
+ }],
1193
+ "style/space-before-blocks": ["error", "always"],
1194
+ "style/space-before-function-paren": ["error", {
1195
+ anonymous: "always",
1196
+ asyncArrow: "always",
1197
+ named: "never"
1198
+ }],
1199
+ "style/space-in-parens": ["error", "never"],
1200
+ "style/space-infix-ops": "error",
1201
+ "style/space-unary-ops": ["error", {
1202
+ nonwords: false,
1203
+ words: true
1204
+ }],
1205
+ "style/spaced-comment": ["error", "always", {
1206
+ block: {
1207
+ balanced: true,
1208
+ exceptions: ["*"],
1209
+ markers: ["!"]
1210
+ },
1211
+ line: {
1212
+ exceptions: ["/", "#"],
1213
+ markers: ["/"]
1214
+ }
1215
+ }],
1216
+ "style/template-curly-spacing": "error",
1217
+ "style/template-tag-spacing": ["error", "never"],
1218
+ "style/type-annotation-spacing": "error",
1219
+ "style/wrap-iife": ["error", "any", {
1220
+ functionPrototypeMethods: true
1221
+ }],
1222
+ "style/yield-star-spacing": ["error", "both"],
1223
+ ...jsx ? {
1224
+ "style/jsx-closing-bracket-location": "error",
1225
+ "style/jsx-closing-tag-location": "error",
1226
+ "style/jsx-curly-brace-presence": ["error", {
1227
+ propElementValues: "always"
1228
+ }],
1229
+ "style/jsx-curly-newline": "error",
1230
+ "style/jsx-curly-spacing": ["error", "never"],
1231
+ "style/jsx-equals-spacing": "error",
1232
+ "style/jsx-first-prop-new-line": "error",
1233
+ "style/jsx-indent": ["error", indent, {
1234
+ checkAttributes: true,
1235
+ indentLogicalExpressions: true
1236
+ }],
1237
+ "style/jsx-indent-props": ["error", indent],
1238
+ "style/jsx-max-props-per-line": ["error", {
1239
+ maximum: 1,
1240
+ when: "multiline"
1241
+ }],
1242
+ "style/jsx-one-expression-per-line": ["error", {
1243
+ allow: "single-child"
1244
+ }],
1245
+ "style/jsx-quotes": "error",
1246
+ "style/jsx-tag-spacing": ["error", {
1247
+ afterOpening: "never",
1248
+ beforeClosing: "never",
1249
+ beforeSelfClosing: "always",
1250
+ closingSlash: "never"
1251
+ }],
1252
+ "style/jsx-wrap-multilines": ["error", {
1253
+ arrow: "parens-new-line",
1254
+ assignment: "parens-new-line",
1255
+ condition: "parens-new-line",
1256
+ declaration: "parens-new-line",
1257
+ logical: "parens-new-line",
1258
+ prop: "parens-new-line",
1259
+ return: "parens-new-line"
1260
+ }]
1261
+ } : {}
1262
+ }
1263
+ }
1264
+ ];
1265
+ }
1266
+
1267
+ // src/configs/test.ts
1268
+ function test(options = {}) {
1269
+ const {
1270
+ isInEditor = false,
1271
+ overrides = {}
1272
+ } = options;
1273
+ return [
1274
+ {
1275
+ name: "config:test:setup",
1276
+ plugins: {
1277
+ test: {
1278
+ ...import_eslint_plugin_vitest.default,
1279
+ rules: {
1280
+ ...import_eslint_plugin_vitest.default.rules,
1281
+ // extend `test/no-only-tests` rule
1282
+ ...import_eslint_plugin_no_only_tests.default.rules
1283
+ }
1284
+ }
1285
+ }
1286
+ },
1287
+ {
1288
+ files: GLOB_TESTS,
1289
+ name: "config:test:rules",
1290
+ rules: {
1291
+ "node/prefer-global/process": "off",
1292
+ "test/consistent-test-it": ["error", { fn: "it", withinDescribe: "it" }],
1293
+ "test/no-identical-title": "error",
1294
+ "test/no-only-tests": isInEditor ? "off" : "error",
1295
+ "test/prefer-hooks-in-order": "error",
1296
+ "test/prefer-lowercase-title": "error",
1297
+ ...overrides
1298
+ }
1299
+ }
1300
+ ];
1301
+ }
1302
+
1303
+ // src/configs/typescript.ts
1304
+ var import_node_process = __toESM(require("process"), 1);
1305
+
1306
+ // src/utils.ts
1307
+ function combine(...configs) {
1308
+ return configs.flat();
1309
+ }
1310
+ function renameRules(rules, from, to) {
1311
+ return Object.fromEntries(
1312
+ Object.entries(rules).map(([key, value]) => {
1313
+ if (key.startsWith(from))
1314
+ return [to + key.slice(from.length), value];
1315
+ return [key, value];
1316
+ })
1317
+ );
1318
+ }
1319
+ function toArray(value) {
1320
+ return Array.isArray(value) ? value : [value];
1321
+ }
1322
+
1323
+ // src/configs/typescript.ts
1324
+ function typescript(options) {
1325
+ const {
1326
+ componentExts = [],
1327
+ overrides = {},
1328
+ parserOptions = {}
1329
+ } = options ?? {};
1330
+ const typeAwareRules = {
1331
+ "dot-notation": "off",
1332
+ "no-implied-eval": "off",
1333
+ "no-throw-literal": "off",
1334
+ "ts/await-thenable": "error",
1335
+ "ts/dot-notation": ["error", { allowKeywords: true }],
1336
+ "ts/no-floating-promises": "error",
1337
+ "ts/no-for-in-array": "error",
1338
+ "ts/no-implied-eval": "error",
1339
+ "ts/no-misused-promises": "error",
1340
+ "ts/no-throw-literal": "error",
1341
+ "ts/no-unnecessary-type-assertion": "error",
1342
+ "ts/no-unsafe-argument": "error",
1343
+ "ts/no-unsafe-assignment": "error",
1344
+ "ts/no-unsafe-call": "error",
1345
+ "ts/no-unsafe-member-access": "error",
1346
+ "ts/no-unsafe-return": "error",
1347
+ "ts/restrict-plus-operands": "error",
1348
+ "ts/restrict-template-expressions": "error",
1349
+ "ts/unbound-method": "error"
1350
+ };
1351
+ const tsconfigPath = options?.tsconfigPath ? toArray(options.tsconfigPath) : void 0;
1352
+ return [
1353
+ {
1354
+ name: "config:typescript:setup",
1355
+ plugins: {
1356
+ antfu: import_eslint_plugin_antfu.default,
1357
+ import: pluginImport,
1358
+ ts: import_eslint_plugin2.default
1359
+ }
1360
+ },
1361
+ {
1362
+ files: [
1363
+ GLOB_SRC,
1364
+ ...componentExts.map((ext) => `**/*.${ext}`)
1365
+ ],
1366
+ languageOptions: {
1367
+ parser: parserTs,
1368
+ parserOptions: {
1369
+ extraFileExtensions: componentExts.map((ext) => `.${ext}`),
1370
+ sourceType: "module",
1371
+ ...tsconfigPath ? {
1372
+ project: tsconfigPath,
1373
+ tsconfigRootDir: import_node_process.default.cwd()
1374
+ } : {},
1375
+ ...parserOptions
1376
+ }
1377
+ },
1378
+ name: "config:typescript:rules",
1379
+ rules: {
1380
+ ...renameRules(
1381
+ import_eslint_plugin2.default.configs["eslint-recommended"].overrides[0].rules,
1382
+ "@typescript-eslint/",
1383
+ "ts/"
1384
+ ),
1385
+ ...renameRules(
1386
+ import_eslint_plugin2.default.configs.strict.rules,
1387
+ "@typescript-eslint/",
1388
+ "ts/"
1389
+ ),
1390
+ "antfu/generic-spacing": "error",
1391
+ "antfu/named-tuple-spacing": "error",
1392
+ "no-dupe-class-members": "off",
1393
+ "no-invalid-this": "off",
1394
+ "no-loss-of-precision": "off",
1395
+ "no-redeclare": "off",
1396
+ "no-use-before-define": "off",
1397
+ "no-useless-constructor": "off",
1398
+ "ts/ban-ts-comment": ["error", {
1399
+ "ts-ignore": "allow-with-description"
1400
+ }],
1401
+ "ts/ban-types": ["error", {
1402
+ types: { Function: false }
1403
+ }],
1404
+ "ts/consistent-type-assertions": ["error", {
1405
+ assertionStyle: "as",
1406
+ objectLiteralTypeAssertions: "allow-as-parameter"
1407
+ }],
1408
+ "ts/consistent-type-definitions": ["error", "interface"],
1409
+ "ts/consistent-type-imports": ["error", {
1410
+ disallowTypeAnnotations: false,
1411
+ prefer: "type-imports"
1412
+ }],
1413
+ "ts/no-dupe-class-members": "error",
1414
+ "ts/no-dynamic-delete": "off",
1415
+ "ts/no-explicit-any": "off",
1416
+ "ts/no-extraneous-class": "off",
1417
+ "ts/no-import-type-side-effects": "error",
1418
+ "ts/no-invalid-this": "error",
1419
+ "ts/no-invalid-void-type": "off",
1420
+ "ts/no-loss-of-precision": "error",
1421
+ "ts/no-non-null-assertion": "off",
1422
+ "ts/no-redeclare": "error",
1423
+ "ts/no-require-imports": "error",
1424
+ "ts/no-unused-vars": "off",
1425
+ "ts/no-use-before-define": ["error", {
1426
+ classes: false,
1427
+ functions: false,
1428
+ variables: true
1429
+ }],
1430
+ "ts/no-useless-constructor": "off",
1431
+ "ts/prefer-ts-expect-error": "error",
1432
+ "ts/triple-slash-reference": "off",
1433
+ "ts/unified-signatures": "off",
1434
+ ...tsconfigPath ? typeAwareRules : {},
1435
+ ...overrides
1436
+ }
1437
+ },
1438
+ {
1439
+ files: ["**/*.d.ts"],
1440
+ name: "config:typescript:dts-overrides",
1441
+ rules: {
1442
+ "eslint-comments/no-unlimited-disable": "off",
1443
+ "import/no-duplicates": "off",
1444
+ "no-restricted-syntax": "off",
1445
+ "unused-imports/no-unused-vars": "off"
1446
+ }
1447
+ },
1448
+ {
1449
+ files: ["**/*.{test,spec}.ts?(x)"],
1450
+ name: "config:typescript:tests-overrides",
1451
+ rules: {
1452
+ "no-unused-expressions": "off"
1453
+ }
1454
+ },
1455
+ {
1456
+ files: ["**/*.js", "**/*.cjs"],
1457
+ name: "config:typescript:javascript-overrides",
1458
+ rules: {
1459
+ "ts/no-require-imports": "off",
1460
+ "ts/no-var-requires": "off"
1461
+ }
1462
+ }
1463
+ ];
1464
+ }
1465
+
1466
+ // src/configs/unicorn.ts
1467
+ function unicorn() {
1468
+ return [
1469
+ {
1470
+ name: "config:unicorn",
1471
+ plugins: {
1472
+ unicorn: import_eslint_plugin_unicorn.default
1473
+ },
1474
+ rules: {
1475
+ "unicorn/better-regex": "error",
1476
+ "unicorn/catch-error-name": "error",
1477
+ "unicorn/custom-error-definition": "error",
1478
+ "unicorn/error-message": "error",
1479
+ "unicorn/escape-case": "error",
1480
+ "unicorn/explicit-length-check": "error",
1481
+ "unicorn/filename-case": ["error", {
1482
+ cases: {
1483
+ kebabCase: true,
1484
+ pascalCase: true
1485
+ },
1486
+ ignore: [/^[A-Z]+\..*$/]
1487
+ }],
1488
+ "unicorn/new-for-builtins": "error",
1489
+ "unicorn/no-array-callback-reference": "error",
1490
+ "unicorn/no-array-method-this-argument": "error",
1491
+ "unicorn/no-array-push-push": "error",
1492
+ "unicorn/no-console-spaces": "error",
1493
+ "unicorn/no-for-loop": "error",
1494
+ "unicorn/no-hex-escape": "error",
1495
+ "unicorn/no-instanceof-array": "error",
1496
+ "unicorn/no-invalid-remove-event-listener": "error",
1497
+ "unicorn/no-lonely-if": "error",
1498
+ "unicorn/no-new-array": "error",
1499
+ "unicorn/no-new-buffer": "error",
1500
+ "unicorn/no-static-only-class": "error",
1501
+ "unicorn/no-unnecessary-await": "error",
1502
+ "unicorn/no-zero-fractions": "error",
1503
+ "unicorn/prefer-add-event-listener": "error",
1504
+ "unicorn/prefer-array-find": "error",
1505
+ "unicorn/prefer-array-flat-map": "error",
1506
+ "unicorn/prefer-array-index-of": "error",
1507
+ "unicorn/prefer-array-some": "error",
1508
+ "unicorn/prefer-at": "error",
1509
+ "unicorn/prefer-blob-reading-methods": "error",
1510
+ "unicorn/prefer-date-now": "error",
1511
+ "unicorn/prefer-dom-node-append": "error",
1512
+ "unicorn/prefer-dom-node-dataset": "error",
1513
+ "unicorn/prefer-dom-node-remove": "error",
1514
+ "unicorn/prefer-dom-node-text-content": "error",
1515
+ "unicorn/prefer-includes": "error",
1516
+ "unicorn/prefer-keyboard-event-key": "error",
1517
+ "unicorn/prefer-math-trunc": "error",
1518
+ "unicorn/prefer-modern-dom-apis": "error",
1519
+ "unicorn/prefer-modern-math-apis": "error",
1520
+ "unicorn/prefer-negative-index": "error",
1521
+ "unicorn/prefer-node-protocol": "error",
1522
+ "unicorn/prefer-number-properties": "error",
1523
+ "unicorn/prefer-optional-catch-binding": "error",
1524
+ "unicorn/prefer-prototype-methods": "error",
1525
+ "unicorn/prefer-query-selector": "error",
1526
+ "unicorn/prefer-reflect-apply": "error",
1527
+ "unicorn/prefer-regexp-test": "error",
1528
+ "unicorn/prefer-string-replace-all": "error",
1529
+ "unicorn/prefer-string-slice": "error",
1530
+ "unicorn/prefer-string-starts-ends-with": "error",
1531
+ "unicorn/prefer-string-trim-start-end": "error",
1532
+ "unicorn/prefer-top-level-await": "error",
1533
+ "unicorn/prefer-type-error": "error",
1534
+ "unicorn/throw-new-error": "error"
1535
+ }
1536
+ }
1537
+ ];
1538
+ }
1539
+
1540
+ // src/configs/unocss.ts
1541
+ function unocss() {
1542
+ return [
1543
+ {
1544
+ name: "config:unocss",
1545
+ plugins: {
1546
+ "@unocss": import_eslint_plugin3.default
1547
+ },
1548
+ rules: {
1549
+ ...import_eslint_plugin3.default.configs.recommended.rules
1550
+ }
1551
+ }
1552
+ ];
1553
+ }
1554
+
1555
+ // src/configs/vue.ts
1556
+ function vue(options = {}) {
1557
+ const {
1558
+ overrides = {},
1559
+ stylistic: stylistic2 = true
1560
+ } = options;
1561
+ const {
1562
+ indent = 4
1563
+ } = typeof stylistic2 === "boolean" ? {} : stylistic2;
1564
+ return [
1565
+ {
1566
+ name: "config:vue:setup",
1567
+ plugins: {
1568
+ vue: import_eslint_plugin_vue.default
1569
+ }
1570
+ },
1571
+ {
1572
+ files: [GLOB_VUE],
1573
+ languageOptions: {
1574
+ parser: import_vue_eslint_parser.default,
1575
+ parserOptions: {
1576
+ ecmaFeatures: {
1577
+ jsx: true
1578
+ },
1579
+ extraFileExtensions: [".vue"],
1580
+ parser: options.typescript ? parserTs : null,
1581
+ sourceType: "module"
1582
+ }
1583
+ },
1584
+ name: "config:vue:rules",
1585
+ processor: import_eslint_plugin_vue.default.processors[".vue"],
1586
+ rules: {
1587
+ ...import_eslint_plugin_vue.default.configs.base.rules,
1588
+ ...import_eslint_plugin_vue.default.configs["vue3-essential"].rules,
1589
+ ...import_eslint_plugin_vue.default.configs["vue3-strongly-recommended"].rules,
1590
+ ...import_eslint_plugin_vue.default.configs["vue3-recommended"].rules,
1591
+ "node/prefer-global/process": "off",
1592
+ "vue/block-order": ["error", {
1593
+ order: ["template", "script", "style"]
1594
+ }],
1595
+ "vue/component-name-in-template-casing": ["error", "PascalCase", {
1596
+ registeredComponentsOnly: false
1597
+ }],
1598
+ "vue/component-options-name-casing": ["error", "PascalCase"],
1599
+ "vue/custom-event-name-casing": ["error", "camelCase"],
1600
+ "vue/define-macros-order": ["error", {
1601
+ order: ["defineOptions", "defineProps", "defineEmits", "defineSlots"]
1602
+ }],
1603
+ "vue/dot-location": ["error", "property"],
1604
+ "vue/dot-notation": ["error", {
1605
+ allowKeywords: true
1606
+ }],
1607
+ "vue/eqeqeq": ["error", "smart"],
1608
+ "vue/html-indent": ["error", indent],
1609
+ "vue/max-attributes-per-line": "off",
1610
+ "vue/multi-word-component-names": "off",
1611
+ "vue/no-constant-condition": "warn",
1612
+ "vue/no-dupe-keys": "off",
1613
+ "vue/no-empty-pattern": "error",
1614
+ "vue/no-extra-parens": ["error", "functions"],
1615
+ "vue/no-irregular-whitespace": "error",
1616
+ "vue/no-loss-of-precision": "error",
1617
+ "vue/no-restricted-syntax": [
1618
+ "error",
1619
+ "DebuggerStatement",
1620
+ "LabeledStatement",
1621
+ "WithStatement"
1622
+ ],
1623
+ "vue/no-restricted-v-bind": ["error", "/^v-/"],
1624
+ "vue/no-setup-props-reactivity-loss": "off",
1625
+ "vue/no-sparse-arrays": "error",
1626
+ "vue/no-unused-refs": "error",
1627
+ "vue/no-useless-v-bind": "error",
1628
+ "vue/no-v-html": "off",
1629
+ "vue/object-shorthand": ["error", "always", {
1630
+ avoidQuotes: true,
1631
+ ignoreConstructors: false
1632
+ }],
1633
+ "vue/prefer-separate-static-class": "error",
1634
+ "vue/prefer-template": "error",
1635
+ "vue/require-default-prop": "off",
1636
+ "vue/require-prop-types": "off",
1637
+ "vue/require-typed-object-prop": "error",
1638
+ "vue/space-infix-ops": "error",
1639
+ "vue/space-unary-ops": ["error", {
1640
+ nonwords: false,
1641
+ words: true
1642
+ }],
1643
+ ...stylistic2 ? {
1644
+ "vue/array-bracket-spacing": ["error", "never"],
1645
+ "vue/arrow-spacing": ["error", {
1646
+ after: true,
1647
+ before: true
1648
+ }],
1649
+ "vue/block-spacing": ["error", "always"],
1650
+ "vue/block-tag-newline": ["error", {
1651
+ multiline: "always",
1652
+ singleline: "always"
1653
+ }],
1654
+ "vue/brace-style": ["error", "stroustrup", {
1655
+ allowSingleLine: true
1656
+ }],
1657
+ "vue/comma-dangle": ["error", "always-multiline"],
1658
+ "vue/comma-spacing": ["error", {
1659
+ after: true,
1660
+ before: false
1661
+ }],
1662
+ "vue/comma-style": ["error", "last"],
1663
+ "vue/html-comment-content-spacing": ["error", "always", {
1664
+ exceptions: ["-"]
1665
+ }],
1666
+ "vue/key-spacing": ["error", {
1667
+ afterColon: true,
1668
+ beforeColon: false
1669
+ }],
1670
+ "vue/keyword-spacing": ["error", {
1671
+ after: true,
1672
+ before: true
1673
+ }],
1674
+ "vue/object-curly-newline": ["error", {
1675
+ consistent: true,
1676
+ multiline: true
1677
+ }],
1678
+ "vue/object-curly-spacing": ["error", "always"],
1679
+ "vue/object-property-newline": ["error", {
1680
+ allowMultiplePropertiesPerLine: true
1681
+ }],
1682
+ "vue/operator-linebreak": ["error", "before"],
1683
+ "vue/padding-line-between-blocks": ["error", "always"],
1684
+ "vue/quote-props": ["error", "consistent-as-needed"],
1685
+ "vue/space-in-parens": ["error", "never"],
1686
+ "vue/template-curly-spacing": "error"
1687
+ } : {},
1688
+ ...overrides
1689
+ }
1690
+ }
1691
+ ];
1692
+ }
1693
+
1694
+ // src/configs/yaml.ts
1695
+ function yaml(options = {}) {
1696
+ const {
1697
+ overrides = {},
1698
+ stylistic: stylistic2 = true
1699
+ } = options;
1700
+ const {
1701
+ indent = 2,
1702
+ quotes = "single"
1703
+ } = typeof stylistic2 === "boolean" ? {} : stylistic2;
1704
+ return [
1705
+ {
1706
+ name: "config:yaml:setup",
1707
+ plugins: {
1708
+ yaml: pluginYaml
1709
+ }
1710
+ },
1711
+ {
1712
+ files: [GLOB_YAML],
1713
+ languageOptions: {
1714
+ parser: import_yaml_eslint_parser.default
1715
+ },
1716
+ name: "config:yaml:rules",
1717
+ rules: {
1718
+ "style/spaced-comment": "off",
1719
+ "yaml/block-mapping": "error",
1720
+ "yaml/block-sequence": "error",
1721
+ "yaml/no-empty-key": "error",
1722
+ "yaml/no-empty-sequence-entry": "error",
1723
+ "yaml/no-irregular-whitespace": "error",
1724
+ "yaml/plain-scalar": "error",
1725
+ "yaml/vue-custom-block/no-parsing-error": "error",
1726
+ ...stylistic2 ? {
1727
+ "yaml/block-mapping-question-indicator-newline": "error",
1728
+ "yaml/block-sequence-hyphen-indicator-newline": "error",
1729
+ "yaml/flow-mapping-curly-newline": "error",
1730
+ "yaml/flow-mapping-curly-spacing": "error",
1731
+ "yaml/flow-sequence-bracket-newline": "error",
1732
+ "yaml/flow-sequence-bracket-spacing": "error",
1733
+ "yaml/indent": ["error", indent === "tab" ? 2 : indent],
1734
+ "yaml/key-spacing": "error",
1735
+ "yaml/no-tab-indent": "error",
1736
+ "yaml/quotes": ["error", {
1737
+ avoidEscape: false,
1738
+ prefer: quotes
1739
+ }],
1740
+ "yaml/spaced-comment": "error"
1741
+ } : {},
1742
+ ...overrides
1743
+ }
1744
+ }
1745
+ ];
1746
+ }
1747
+
1748
+ // src/factory.ts
1749
+ var flatConfigProps = [
1750
+ "files",
1751
+ "ignores",
1752
+ "languageOptions",
1753
+ "linterOptions",
1754
+ "processor",
1755
+ "plugins",
1756
+ "rules",
1757
+ "settings"
1758
+ ];
1759
+ var VuePackages = [
1760
+ "vue",
1761
+ "nuxt",
1762
+ "vitepress",
1763
+ "@slidev/cli"
1764
+ ];
1765
+ var UnocssPackages = [
1766
+ "unocss",
1767
+ "@unocss/nuxt"
1768
+ ];
1769
+ function config(options = {}, ...userConfigs) {
1770
+ const {
1771
+ componentExts = [],
1772
+ gitignore: enableGitignore = true,
1773
+ isInEditor = !!((import_node_process2.default.env.VSCODE_PID || import_node_process2.default.env.JETBRAINS_IDE) && !import_node_process2.default.env.CI),
1774
+ overrides = {},
1775
+ typescript: enableTypeScript = (0, import_local_pkg.isPackageExists)("typescript"),
1776
+ unocss: enableUnocss = UnocssPackages.some((i) => (0, import_local_pkg.isPackageExists)(i)),
1777
+ vue: enableVue = VuePackages.some((i) => (0, import_local_pkg.isPackageExists)(i))
1778
+ } = options;
1779
+ const stylisticOptions = options.stylistic === false ? false : typeof options.stylistic === "object" ? options.stylistic : {};
1780
+ if (stylisticOptions && !("jsx" in stylisticOptions))
1781
+ stylisticOptions.jsx = options.jsx ?? true;
1782
+ const configs = [];
1783
+ if (enableGitignore) {
1784
+ if (typeof enableGitignore !== "boolean") {
1785
+ configs.push([(0, import_eslint_config_flat_gitignore.default)(enableGitignore)]);
1786
+ } else {
1787
+ if (import_node_fs.default.existsSync(".gitignore"))
1788
+ configs.push([(0, import_eslint_config_flat_gitignore.default)()]);
1789
+ }
1790
+ }
1791
+ configs.push(
1792
+ ignores(),
1793
+ javascript({
1794
+ isInEditor,
1795
+ overrides: overrides.javascript
1796
+ }),
1797
+ comments(),
1798
+ node(),
1799
+ perfectionist({
1800
+ overrides: overrides.perfectionist
1801
+ }),
1802
+ jsdoc({
1803
+ stylistic: stylisticOptions
1804
+ }),
1805
+ imports({
1806
+ stylistic: stylisticOptions
1807
+ }),
1808
+ unicorn()
1809
+ );
1810
+ if (enableVue)
1811
+ componentExts.push("vue");
1812
+ if (enableTypeScript) {
1813
+ configs.push(typescript({
1814
+ ...typeof enableTypeScript !== "boolean" ? enableTypeScript : {},
1815
+ componentExts,
1816
+ overrides: overrides.typescript
1817
+ }));
1818
+ }
1819
+ if (stylisticOptions)
1820
+ configs.push(stylistic(stylisticOptions));
1821
+ if (enableUnocss)
1822
+ configs.push(unocss());
1823
+ if (options.test ?? true) {
1824
+ configs.push(test({
1825
+ isInEditor,
1826
+ overrides: overrides.test
1827
+ }));
1828
+ }
1829
+ if (enableVue) {
1830
+ configs.push(vue({
1831
+ overrides: overrides.vue,
1832
+ stylistic: stylisticOptions,
1833
+ typescript: !!enableTypeScript
1834
+ }));
1835
+ }
1836
+ if (options.jsonc ?? true) {
1837
+ configs.push(
1838
+ jsonc({
1839
+ overrides: overrides.jsonc,
1840
+ stylistic: stylisticOptions
1841
+ }),
1842
+ sortPackageJson(),
1843
+ sortTsconfig()
1844
+ );
1845
+ }
1846
+ if (options.yaml ?? true) {
1847
+ configs.push(yaml({
1848
+ overrides: overrides.yaml,
1849
+ stylistic: stylisticOptions
1850
+ }));
1851
+ }
1852
+ if (options.markdown ?? true) {
1853
+ configs.push(markdown({
1854
+ componentExts,
1855
+ overrides: overrides.markdown
1856
+ }));
1857
+ }
1858
+ const fusedConfig = flatConfigProps.reduce((acc, key) => {
1859
+ if (key in options)
1860
+ acc[key] = options[key];
1861
+ return acc;
1862
+ }, {});
1863
+ if (Object.keys(fusedConfig).length > 0)
1864
+ configs.push([fusedConfig]);
1865
+ const merged = combine(
1866
+ ...configs,
1867
+ ...userConfigs
1868
+ );
1869
+ return merged;
1870
+ }
1871
+
1872
+ // src/index.ts
1873
+ var src_default = config;
1874
+ // Annotate the CommonJS export names for ESM import in node:
1875
+ 0 && (module.exports = {
1876
+ GLOB_ALL_SRC,
1877
+ GLOB_CSS,
1878
+ GLOB_DIST,
1879
+ GLOB_EXCLUDE,
1880
+ GLOB_HTML,
1881
+ GLOB_JS,
1882
+ GLOB_JSON,
1883
+ GLOB_JSON5,
1884
+ GLOB_JSONC,
1885
+ GLOB_JSX,
1886
+ GLOB_LESS,
1887
+ GLOB_LOCKFILE,
1888
+ GLOB_MARKDOWN,
1889
+ GLOB_MARKDOWN_CODE,
1890
+ GLOB_NODE_MODULES,
1891
+ GLOB_SCSS,
1892
+ GLOB_SRC,
1893
+ GLOB_SRC_EXT,
1894
+ GLOB_STYLE,
1895
+ GLOB_TESTS,
1896
+ GLOB_TS,
1897
+ GLOB_TSX,
1898
+ GLOB_VUE,
1899
+ GLOB_YAML,
1900
+ combine,
1901
+ comments,
1902
+ config,
1903
+ ignores,
1904
+ imports,
1905
+ javascript,
1906
+ jsdoc,
1907
+ jsonc,
1908
+ markdown,
1909
+ node,
1910
+ parserJsonc,
1911
+ parserTs,
1912
+ parserVue,
1913
+ parserYaml,
1914
+ perfectionist,
1915
+ pluginAntfu,
1916
+ pluginComments,
1917
+ pluginImport,
1918
+ pluginJsdoc,
1919
+ pluginJsonc,
1920
+ pluginMarkdown,
1921
+ pluginNoOnlyTests,
1922
+ pluginNode,
1923
+ pluginPerfectionist,
1924
+ pluginPromise,
1925
+ pluginStylistic,
1926
+ pluginTs,
1927
+ pluginUnicorn,
1928
+ pluginUnocss,
1929
+ pluginUnusedImports,
1930
+ pluginVitest,
1931
+ pluginVue,
1932
+ pluginYaml,
1933
+ renameRules,
1934
+ sortPackageJson,
1935
+ sortTsconfig,
1936
+ stylistic,
1937
+ test,
1938
+ toArray,
1939
+ typescript,
1940
+ unicorn,
1941
+ unocss,
1942
+ vue,
1943
+ yaml
1944
+ });