@cany748/eslint-config 2.0.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 ADDED
@@ -0,0 +1,1330 @@
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_ASTRO: () => GLOB_ASTRO,
35
+ GLOB_ASTRO_TS: () => GLOB_ASTRO_TS,
36
+ GLOB_CSS: () => GLOB_CSS,
37
+ GLOB_EXCLUDE: () => GLOB_EXCLUDE,
38
+ GLOB_GRAPHQL: () => GLOB_GRAPHQL,
39
+ GLOB_HTML: () => GLOB_HTML,
40
+ GLOB_JS: () => GLOB_JS,
41
+ GLOB_JSON: () => GLOB_JSON,
42
+ GLOB_JSON5: () => GLOB_JSON5,
43
+ GLOB_JSONC: () => GLOB_JSONC,
44
+ GLOB_JSX: () => GLOB_JSX,
45
+ GLOB_LESS: () => GLOB_LESS,
46
+ GLOB_MARKDOWN: () => GLOB_MARKDOWN,
47
+ GLOB_MARKDOWN_CODE: () => GLOB_MARKDOWN_CODE,
48
+ GLOB_MARKDOWN_IN_MARKDOWN: () => GLOB_MARKDOWN_IN_MARKDOWN,
49
+ GLOB_POSTCSS: () => GLOB_POSTCSS,
50
+ GLOB_SCSS: () => GLOB_SCSS,
51
+ GLOB_SRC: () => GLOB_SRC,
52
+ GLOB_SRC_EXT: () => GLOB_SRC_EXT,
53
+ GLOB_STYLE: () => GLOB_STYLE,
54
+ GLOB_SVELTE: () => GLOB_SVELTE,
55
+ GLOB_TESTS: () => GLOB_TESTS,
56
+ GLOB_TOML: () => GLOB_TOML,
57
+ GLOB_TS: () => GLOB_TS,
58
+ GLOB_TSX: () => GLOB_TSX,
59
+ GLOB_VUE: () => GLOB_VUE,
60
+ GLOB_XML: () => GLOB_XML,
61
+ GLOB_YAML: () => GLOB_YAML,
62
+ combine: () => combine,
63
+ comments: () => comments,
64
+ factoryConfig: () => factoryConfig,
65
+ formatters: () => formatters,
66
+ ignores: () => ignores,
67
+ imports: () => imports,
68
+ interopDefault: () => interopDefault,
69
+ isInEditorEnv: () => isInEditorEnv,
70
+ javascript: () => javascript,
71
+ jsonc: () => jsonc,
72
+ node: () => node,
73
+ parserPlain: () => parserPlain,
74
+ regexp: () => regexp,
75
+ sortPackageJson: () => sortPackageJson,
76
+ sortTsconfig: () => sortTsconfig,
77
+ test: () => test,
78
+ toArray: () => toArray,
79
+ typescript: () => typescript,
80
+ unicorn: () => unicorn,
81
+ unocss: () => unocss,
82
+ vue: () => vue
83
+ });
84
+ module.exports = __toCommonJS(src_exports);
85
+
86
+ // src/configs/comments.ts
87
+ var import_eslint_plugin_eslint_comments = __toESM(require("eslint-plugin-eslint-comments"), 1);
88
+ function comments() {
89
+ return [
90
+ {
91
+ name: "eslint-comments",
92
+ plugins: {
93
+ "eslint-comments": import_eslint_plugin_eslint_comments.default
94
+ },
95
+ rules: {
96
+ ...import_eslint_plugin_eslint_comments.default.configs.recommended.rules,
97
+ "eslint-comments/disable-enable-pair": "off"
98
+ }
99
+ }
100
+ ];
101
+ }
102
+
103
+ // src/configs/formatters.ts
104
+ var import_eslint_plugin_prettier = __toESM(require("eslint-plugin-prettier"), 1);
105
+ var import_recommended = __toESM(require("eslint-plugin-prettier/recommended"), 1);
106
+
107
+ // src/globs.ts
108
+ var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
109
+ var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
110
+ var GLOB_JS = "**/*.?([cm])js";
111
+ var GLOB_JSX = "**/*.?([cm])jsx";
112
+ var GLOB_TS = "**/*.?([cm])ts";
113
+ var GLOB_TSX = "**/*.?([cm])tsx";
114
+ var GLOB_STYLE = "**/*.{c,le,sc}ss";
115
+ var GLOB_CSS = "**/*.css";
116
+ var GLOB_POSTCSS = "**/*.{p,post}css";
117
+ var GLOB_LESS = "**/*.less";
118
+ var GLOB_SCSS = "**/*.scss";
119
+ var GLOB_JSON = "**/*.json";
120
+ var GLOB_JSON5 = "**/*.json5";
121
+ var GLOB_JSONC = "**/*.jsonc";
122
+ var GLOB_MARKDOWN = "**/*.md";
123
+ var GLOB_MARKDOWN_IN_MARKDOWN = "**/*.md/*.md";
124
+ var GLOB_SVELTE = "**/*.svelte";
125
+ var GLOB_VUE = "**/*.vue";
126
+ var GLOB_YAML = "**/*.y?(a)ml";
127
+ var GLOB_TOML = "**/*.toml";
128
+ var GLOB_XML = "**/*.xml";
129
+ var GLOB_HTML = "**/*.htm?(l)";
130
+ var GLOB_ASTRO = "**/*.astro";
131
+ var GLOB_ASTRO_TS = "**/*.astro/*.ts";
132
+ var GLOB_GRAPHQL = "**/*.{g,graph}ql";
133
+ var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
134
+ var GLOB_TESTS = [
135
+ `**/__tests__/**/*.${GLOB_SRC_EXT}`,
136
+ `**/*.spec.${GLOB_SRC_EXT}`,
137
+ `**/*.test.${GLOB_SRC_EXT}`,
138
+ `**/*.bench.${GLOB_SRC_EXT}`,
139
+ `**/*.benchmark.${GLOB_SRC_EXT}`
140
+ ];
141
+ var GLOB_ALL_SRC = [
142
+ GLOB_SRC,
143
+ GLOB_STYLE,
144
+ GLOB_JSON,
145
+ GLOB_JSON5,
146
+ GLOB_MARKDOWN,
147
+ GLOB_SVELTE,
148
+ GLOB_VUE,
149
+ GLOB_YAML,
150
+ GLOB_XML,
151
+ GLOB_HTML
152
+ ];
153
+ var GLOB_EXCLUDE = [
154
+ "**/node_modules",
155
+ "**/dist",
156
+ "**/build",
157
+ "**/vendor",
158
+ "**/public",
159
+ "**/out",
160
+ "**/package-lock.json",
161
+ "**/yarn.lock",
162
+ "**/pnpm-lock.yaml",
163
+ "**/bun.lockb",
164
+ "**/output",
165
+ "**/coverage",
166
+ "**/temp",
167
+ "**/.temp",
168
+ "**/tmp",
169
+ "**/.tmp",
170
+ "**/.history",
171
+ "**/.vitepress/cache",
172
+ "**/.nuxt",
173
+ "**/.next",
174
+ "**/.svelte-kit",
175
+ "**/.vercel",
176
+ "**/.netlify",
177
+ "**/.changeset",
178
+ "**/.idea",
179
+ "**/.cache",
180
+ "**/.output",
181
+ "**/.vite-inspect",
182
+ "**/.yarn",
183
+ "**/vite.config.*.timestamp-*",
184
+ "**/CHANGELOG*.md",
185
+ "**/*.min.*",
186
+ "**/LICENSE*",
187
+ "**/__snapshots__",
188
+ "**/auto-import?(s).d.ts",
189
+ "**/components.d.ts"
190
+ ];
191
+
192
+ // src/utils.ts
193
+ var parserPlain = {
194
+ meta: {
195
+ name: "parser-plain"
196
+ },
197
+ parseForESLint: (code) => ({
198
+ ast: {
199
+ body: [],
200
+ comments: [],
201
+ loc: { end: code.length, start: 0 },
202
+ range: [0, code.length],
203
+ tokens: [],
204
+ type: "Program"
205
+ },
206
+ scopeManager: null,
207
+ services: { isPlain: true },
208
+ visitorKeys: {
209
+ Program: []
210
+ }
211
+ })
212
+ };
213
+ async function combine(...configs2) {
214
+ const resolved = await Promise.all(configs2);
215
+ return resolved.flat();
216
+ }
217
+ function toArray(value) {
218
+ return Array.isArray(value) ? value : [value];
219
+ }
220
+ async function interopDefault(m) {
221
+ const resolved = await m;
222
+ return resolved.default || resolved;
223
+ }
224
+ function isInEditorEnv() {
225
+ return !!((process.env.VSCODE_PID || process.env.VSCODE_CWD || process.env.JETBRAINS_IDE || process.env.VIM || process.env.NVIM) && !process.env.CI);
226
+ }
227
+
228
+ // src/configs/formatters.ts
229
+ function formatters(options = true) {
230
+ if (options === true) {
231
+ options = {
232
+ css: true,
233
+ graphql: true,
234
+ html: true,
235
+ markdown: true
236
+ };
237
+ }
238
+ const configs2 = [
239
+ {
240
+ name: "formatter/setup",
241
+ plugins: {
242
+ prettier: import_eslint_plugin_prettier.default
243
+ },
244
+ rules: import_recommended.default.rules
245
+ }
246
+ ];
247
+ if (options.css) {
248
+ configs2.push(
249
+ {
250
+ files: [GLOB_CSS, GLOB_POSTCSS],
251
+ languageOptions: {
252
+ parser: parserPlain
253
+ },
254
+ name: "formatter/css",
255
+ rules: {
256
+ "prettier/prettier": ["error", { parser: "css" }]
257
+ }
258
+ },
259
+ {
260
+ files: [GLOB_SCSS],
261
+ languageOptions: {
262
+ parser: parserPlain
263
+ },
264
+ name: "formatter/scss",
265
+ rules: {
266
+ "prettier/prettier": ["error", { parser: "scss" }]
267
+ }
268
+ },
269
+ {
270
+ files: [GLOB_LESS],
271
+ languageOptions: {
272
+ parser: parserPlain
273
+ },
274
+ name: "formatter/less",
275
+ rules: {
276
+ "prettier/prettier": ["error", { parser: "less" }]
277
+ }
278
+ }
279
+ );
280
+ }
281
+ if (options.graphql) {
282
+ configs2.push({
283
+ files: [GLOB_GRAPHQL],
284
+ languageOptions: {
285
+ parser: parserPlain
286
+ },
287
+ name: "formatter/graphql",
288
+ rules: {
289
+ "prettier/prettier": ["error", { parser: "graphql" }]
290
+ }
291
+ });
292
+ }
293
+ if (options.html) {
294
+ configs2.push({
295
+ files: [GLOB_HTML],
296
+ languageOptions: {
297
+ parser: parserPlain
298
+ },
299
+ name: "formatter/html",
300
+ rules: {
301
+ "prettier/prettier": ["error", { parser: "html" }]
302
+ }
303
+ });
304
+ }
305
+ if (options.markdown) {
306
+ configs2.push({
307
+ files: [GLOB_MARKDOWN],
308
+ languageOptions: {
309
+ parser: parserPlain
310
+ },
311
+ name: "formatter/markdown",
312
+ rules: {
313
+ "prettier/prettier": ["error", { parser: "markdown" }]
314
+ }
315
+ });
316
+ }
317
+ return configs2;
318
+ }
319
+
320
+ // src/configs/ignores.ts
321
+ function ignores() {
322
+ return [
323
+ {
324
+ ignores: GLOB_EXCLUDE
325
+ }
326
+ ];
327
+ }
328
+
329
+ // src/configs/imports.ts
330
+ var pluginImport = __toESM(require("eslint-plugin-import-x"), 1);
331
+ function imports() {
332
+ return [
333
+ {
334
+ name: "imports",
335
+ plugins: {
336
+ import: pluginImport
337
+ },
338
+ rules: {
339
+ "import/export": "error",
340
+ "import/first": "error",
341
+ "import/newline-after-import": ["error", { considerComments: true, count: 1 }],
342
+ "import/no-duplicates": "error",
343
+ "import/no-mutable-exports": "error",
344
+ "import/no-named-default": "error",
345
+ "import/no-self-import": "error",
346
+ "import/no-webpack-loader-syntax": "error",
347
+ "import/order": "error"
348
+ }
349
+ }
350
+ ];
351
+ }
352
+
353
+ // src/configs/javascript.ts
354
+ var import_globals = __toESM(require("globals"), 1);
355
+ var import_eslint_plugin_unused_imports = __toESM(require("eslint-plugin-unused-imports"), 1);
356
+ function javascript(options = {}) {
357
+ const { isInEditor = false, overrides = {} } = options;
358
+ return [
359
+ {
360
+ languageOptions: {
361
+ ecmaVersion: 2022,
362
+ globals: {
363
+ ...import_globals.default.browser,
364
+ ...import_globals.default.es2021,
365
+ ...import_globals.default.node,
366
+ document: "readonly",
367
+ navigator: "readonly",
368
+ window: "readonly"
369
+ },
370
+ parserOptions: {
371
+ ecmaFeatures: {
372
+ jsx: true
373
+ },
374
+ ecmaVersion: 2022,
375
+ sourceType: "module"
376
+ },
377
+ sourceType: "module"
378
+ },
379
+ linterOptions: {
380
+ reportUnusedDisableDirectives: true
381
+ },
382
+ name: "javascript/rules",
383
+ plugins: {
384
+ "unused-imports": import_eslint_plugin_unused_imports.default
385
+ },
386
+ rules: {
387
+ "accessor-pairs": ["error", { enforceForClassMembers: true, setWithoutGet: true }],
388
+ "array-callback-return": "error",
389
+ "block-scoped-var": "error",
390
+ camelcase: [
391
+ "error",
392
+ { properties: "never", ignoreDestructuring: true, ignoreGlobals: true, ignoreImports: true, allow: ["^UNSAFE_"] }
393
+ ],
394
+ "constructor-super": "error",
395
+ "default-case-last": "error",
396
+ "dot-notation": ["error", { allowKeywords: true }],
397
+ eqeqeq: ["error", "smart"],
398
+ "for-direction": "error",
399
+ "getter-return": "error",
400
+ "new-cap": ["error", { capIsNew: false, newIsCap: true, properties: true }],
401
+ "no-alert": "error",
402
+ "no-array-constructor": "error",
403
+ "no-async-promise-executor": "error",
404
+ "no-caller": "error",
405
+ "no-case-declarations": "error",
406
+ "no-class-assign": "error",
407
+ "no-compare-neg-zero": "error",
408
+ "no-cond-assign": ["error", "always"],
409
+ "no-console": ["error", { allow: ["warn", "error"] }],
410
+ "no-const-assign": "error",
411
+ "no-constant-binary-expression": "error",
412
+ "no-constant-condition": "error",
413
+ "no-control-regex": "error",
414
+ "no-debugger": "error",
415
+ "no-delete-var": "error",
416
+ "no-dupe-args": "error",
417
+ "no-dupe-class-members": "error",
418
+ "no-dupe-else-if": "error",
419
+ "no-dupe-keys": "error",
420
+ "no-duplicate-case": "error",
421
+ "no-duplicate-imports": "error",
422
+ "no-empty-character-class": "error",
423
+ "no-empty-pattern": "error",
424
+ "no-empty-static-block": "error",
425
+ "no-empty": ["error", { allowEmptyCatch: true }],
426
+ "no-eval": "error",
427
+ "no-ex-assign": "error",
428
+ "no-extend-native": "error",
429
+ "no-extra-bind": "error",
430
+ "no-extra-boolean-cast": "error",
431
+ "no-fallthrough": "error",
432
+ "no-func-assign": "error",
433
+ "no-global-assign": "error",
434
+ "no-implied-eval": "error",
435
+ "no-import-assign": "error",
436
+ "no-invalid-regexp": "error",
437
+ "no-irregular-whitespace": "error",
438
+ "no-iterator": "error",
439
+ "no-labels": ["error", { allowLoop: false, allowSwitch: false }],
440
+ "no-lone-blocks": "error",
441
+ "no-lonely-if": "error",
442
+ "no-loss-of-precision": "error",
443
+ "no-misleading-character-class": "error",
444
+ "no-multi-str": "error",
445
+ "no-new-func": "error",
446
+ "no-new-native-nonconstructor": "error",
447
+ "no-new-wrappers": "error",
448
+ "no-new": "error",
449
+ "no-nonoctal-decimal-escape": "error",
450
+ "no-obj-calls": "error",
451
+ "no-octal-escape": "error",
452
+ "no-octal": "error",
453
+ "no-proto": "error",
454
+ "no-prototype-builtins": "error",
455
+ "no-redeclare": ["error", { builtinGlobals: false }],
456
+ "no-regex-spaces": "error",
457
+ "no-restricted-globals": [
458
+ "error",
459
+ { message: "Use `globalThis` instead.", name: "global" },
460
+ { message: "Use `globalThis` instead.", name: "self" }
461
+ ],
462
+ "no-restricted-properties": [
463
+ "error",
464
+ { message: "Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.", property: "__proto__" },
465
+ { message: "Use `Object.defineProperty` instead.", property: "__defineGetter__" },
466
+ { message: "Use `Object.defineProperty` instead.", property: "__defineSetter__" },
467
+ { message: "Use `Object.getOwnPropertyDescriptor` instead.", property: "__lookupGetter__" },
468
+ { message: "Use `Object.getOwnPropertyDescriptor` instead.", property: "__lookupSetter__" }
469
+ ],
470
+ "no-restricted-syntax": [
471
+ "error",
472
+ "DebuggerStatement",
473
+ "LabeledStatement",
474
+ "WithStatement",
475
+ "TSEnumDeclaration[const=true]",
476
+ "TSExportAssignment"
477
+ ],
478
+ "no-return-assign": ["error", "except-parens"],
479
+ "no-self-assign": ["error", { props: true }],
480
+ "no-self-compare": "error",
481
+ "no-sequences": "error",
482
+ "no-setter-return": "error",
483
+ "no-shadow-restricted-names": "error",
484
+ "no-sparse-arrays": "error",
485
+ "no-template-curly-in-string": "error",
486
+ "no-this-before-super": "error",
487
+ "no-throw-literal": "error",
488
+ "no-undef-init": "error",
489
+ "no-undef": "error",
490
+ "no-unexpected-multiline": "error",
491
+ "no-unmodified-loop-condition": "error",
492
+ "no-unneeded-ternary": ["error", { defaultAssignment: false }],
493
+ "no-unreachable": "error",
494
+ "no-unreachable-loop": "error",
495
+ "no-unsafe-finally": "error",
496
+ "no-unsafe-negation": "error",
497
+ "no-unsafe-optional-chaining": "error",
498
+ "no-unused-expressions": [
499
+ "error",
500
+ {
501
+ allowShortCircuit: true,
502
+ allowTaggedTemplates: true,
503
+ allowTernary: true
504
+ }
505
+ ],
506
+ "no-unused-private-class-members": "error",
507
+ "no-unused-vars": "off",
508
+ "no-use-before-define": ["error", { classes: false, functions: false, variables: true }],
509
+ "no-useless-backreference": "error",
510
+ "no-useless-call": "error",
511
+ "no-useless-catch": "error",
512
+ "no-useless-computed-key": "error",
513
+ "no-useless-constructor": "error",
514
+ "no-useless-escape": "error",
515
+ "no-useless-rename": "error",
516
+ "no-useless-return": "error",
517
+ "no-var": "error",
518
+ "no-void": ["error", { allowAsStatement: true }],
519
+ "no-with": "error",
520
+ "object-shorthand": [
521
+ "error",
522
+ "always",
523
+ {
524
+ avoidQuotes: true,
525
+ ignoreConstructors: false
526
+ }
527
+ ],
528
+ "one-var": ["error", { initialized: "never" }],
529
+ "prefer-arrow-callback": [
530
+ "error",
531
+ {
532
+ allowNamedFunctions: false,
533
+ allowUnboundThis: true
534
+ }
535
+ ],
536
+ "prefer-const": [
537
+ "error",
538
+ {
539
+ destructuring: "all",
540
+ ignoreReadBeforeAssign: true
541
+ }
542
+ ],
543
+ "prefer-exponentiation-operator": "error",
544
+ "prefer-promise-reject-errors": "error",
545
+ "prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
546
+ "prefer-rest-params": "error",
547
+ "prefer-spread": "error",
548
+ "prefer-template": "error",
549
+ "require-await": "error",
550
+ "require-yield": "error",
551
+ "sort-imports": [
552
+ "error",
553
+ {
554
+ allowSeparatedGroups: false,
555
+ ignoreCase: false,
556
+ ignoreDeclarationSort: true,
557
+ ignoreMemberSort: false,
558
+ memberSyntaxSortOrder: ["none", "all", "multiple", "single"]
559
+ }
560
+ ],
561
+ "symbol-description": "error",
562
+ "unicode-bom": ["error", "never"],
563
+ "unused-imports/no-unused-imports": isInEditor ? "off" : "error",
564
+ "unused-imports/no-unused-vars": [
565
+ "error",
566
+ {
567
+ args: "after-used",
568
+ argsIgnorePattern: "^_",
569
+ ignoreRestSiblings: true,
570
+ vars: "all",
571
+ varsIgnorePattern: "^_"
572
+ }
573
+ ],
574
+ "use-isnan": ["error", { enforceForIndexOf: true, enforceForSwitchCase: true }],
575
+ "valid-typeof": ["error", { requireStringLiterals: true }],
576
+ "vars-on-top": "error",
577
+ yoda: ["error", "never"],
578
+ ...overrides
579
+ }
580
+ },
581
+ {
582
+ files: [`scripts/${GLOB_SRC}`, `cli.${GLOB_SRC_EXT}`],
583
+ name: "javascript/disables/cli",
584
+ rules: {
585
+ "no-console": "off"
586
+ }
587
+ },
588
+ {
589
+ files: ["**/*.{test,spec}.js?(x)"],
590
+ name: "javascript/disables/test",
591
+ rules: {
592
+ "no-unused-expressions": "off"
593
+ }
594
+ }
595
+ ];
596
+ }
597
+
598
+ // src/configs/jsonc.ts
599
+ async function jsonc(options = {}) {
600
+ const { files = [GLOB_JSON, GLOB_JSON5, GLOB_JSONC] } = options;
601
+ const [pluginJsonc, parserJsonc] = await Promise.all([
602
+ interopDefault(import("eslint-plugin-jsonc")),
603
+ interopDefault(import("jsonc-eslint-parser"))
604
+ ]);
605
+ return [
606
+ {
607
+ name: "jsonc",
608
+ files,
609
+ languageOptions: {
610
+ parser: parserJsonc
611
+ },
612
+ plugins: {
613
+ jsonc: pluginJsonc
614
+ },
615
+ rules: {
616
+ ...pluginJsonc.configs["recommended-with-jsonc"].rules,
617
+ ...pluginJsonc.configs.prettier.rules
618
+ }
619
+ }
620
+ ];
621
+ }
622
+
623
+ // src/configs/node.ts
624
+ var import_eslint_plugin_n = __toESM(require("eslint-plugin-n"), 1);
625
+ function node() {
626
+ return [
627
+ {
628
+ name: "node",
629
+ plugins: {
630
+ n: import_eslint_plugin_n.default
631
+ },
632
+ rules: {
633
+ "n/handle-callback-err": ["error", "^(err|error)$"],
634
+ "n/no-deprecated-api": "error",
635
+ "n/no-exports-assign": "error",
636
+ "n/no-new-require": "error",
637
+ "n/no-path-concat": "error",
638
+ "n/prefer-global/buffer": ["error", "always"],
639
+ "n/prefer-global/console": ["error", "always"],
640
+ "n/prefer-global/process": ["error", "always"],
641
+ "n/prefer-global/text-decoder": ["error", "always"],
642
+ "n/prefer-global/text-encoder": ["error", "always"],
643
+ "n/prefer-global/url": ["error", "always"],
644
+ "n/prefer-global/url-search-params": ["error", "always"],
645
+ "n/process-exit-as-throw": "error"
646
+ }
647
+ }
648
+ ];
649
+ }
650
+
651
+ // src/configs/sort.ts
652
+ function sortPackageJson() {
653
+ return [
654
+ {
655
+ files: ["**/package.json"],
656
+ name: "sort/package-json",
657
+ rules: {
658
+ "jsonc/sort-array-values": [
659
+ "error",
660
+ {
661
+ order: { type: "asc" },
662
+ pathPattern: "^files$"
663
+ }
664
+ ],
665
+ "jsonc/sort-keys": [
666
+ "error",
667
+ {
668
+ order: [
669
+ "publisher",
670
+ "name",
671
+ "displayName",
672
+ "type",
673
+ "version",
674
+ "private",
675
+ "packageManager",
676
+ "description",
677
+ "author",
678
+ "contributors",
679
+ "license",
680
+ "funding",
681
+ "homepage",
682
+ "repository",
683
+ "bugs",
684
+ "keywords",
685
+ "categories",
686
+ "sideEffects",
687
+ "exports",
688
+ "main",
689
+ "module",
690
+ "unpkg",
691
+ "jsdelivr",
692
+ "types",
693
+ "typesVersions",
694
+ "bin",
695
+ "icon",
696
+ "files",
697
+ "engines",
698
+ "activationEvents",
699
+ "contributes",
700
+ "scripts",
701
+ "peerDependencies",
702
+ "peerDependenciesMeta",
703
+ "dependencies",
704
+ "optionalDependencies",
705
+ "devDependencies",
706
+ "pnpm",
707
+ "overrides",
708
+ "resolutions",
709
+ "husky",
710
+ "simple-git-hooks",
711
+ "lint-staged",
712
+ "eslintConfig",
713
+ "prettier",
714
+ "stylelint"
715
+ ],
716
+ pathPattern: "^$"
717
+ },
718
+ {
719
+ order: { type: "asc" },
720
+ pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"
721
+ },
722
+ {
723
+ order: { type: "asc" },
724
+ pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$"
725
+ },
726
+ {
727
+ order: ["types", "import", "require", "default"],
728
+ pathPattern: "^exports.*$"
729
+ },
730
+ {
731
+ order: [
732
+ // client hooks only
733
+ "pre-commit",
734
+ "prepare-commit-msg",
735
+ "commit-msg",
736
+ "post-commit",
737
+ "pre-rebase",
738
+ "post-rewrite",
739
+ "post-checkout",
740
+ "post-merge",
741
+ "pre-push",
742
+ "pre-auto-gc"
743
+ ],
744
+ pathPattern: "^(?:gitHooks|husky|simple-git-hooks)$"
745
+ }
746
+ ]
747
+ }
748
+ }
749
+ ];
750
+ }
751
+ function sortTsconfig() {
752
+ return [
753
+ {
754
+ files: ["**/tsconfig.json", "**/tsconfig.*.json"],
755
+ name: "sort/tsconfig-json",
756
+ rules: {
757
+ "jsonc/sort-keys": [
758
+ "error",
759
+ {
760
+ order: ["extends", "compilerOptions", "references", "files", "include", "exclude"],
761
+ pathPattern: "^$"
762
+ },
763
+ {
764
+ order: [
765
+ /* Projects */
766
+ "incremental",
767
+ "composite",
768
+ "tsBuildInfoFile",
769
+ "disableSourceOfProjectReferenceRedirect",
770
+ "disableSolutionSearching",
771
+ "disableReferencedProjectLoad",
772
+ /* Language and Environment */
773
+ "target",
774
+ "jsx",
775
+ "jsxFactory",
776
+ "jsxFragmentFactory",
777
+ "jsxImportSource",
778
+ "lib",
779
+ "moduleDetection",
780
+ "noLib",
781
+ "reactNamespace",
782
+ "useDefineForClassFields",
783
+ "emitDecoratorMetadata",
784
+ "experimentalDecorators",
785
+ /* Modules */
786
+ "baseUrl",
787
+ "rootDir",
788
+ "rootDirs",
789
+ "customConditions",
790
+ "module",
791
+ "moduleResolution",
792
+ "moduleSuffixes",
793
+ "noResolve",
794
+ "paths",
795
+ "resolveJsonModule",
796
+ "resolvePackageJsonExports",
797
+ "resolvePackageJsonImports",
798
+ "typeRoots",
799
+ "types",
800
+ "allowArbitraryExtensions",
801
+ "allowImportingTsExtensions",
802
+ "allowUmdGlobalAccess",
803
+ /* JavaScript Support */
804
+ "allowJs",
805
+ "checkJs",
806
+ "maxNodeModuleJsDepth",
807
+ /* Type Checking */
808
+ "strict",
809
+ "strictBindCallApply",
810
+ "strictFunctionTypes",
811
+ "strictNullChecks",
812
+ "strictPropertyInitialization",
813
+ "allowUnreachableCode",
814
+ "allowUnusedLabels",
815
+ "alwaysStrict",
816
+ "exactOptionalPropertyTypes",
817
+ "noFallthroughCasesInSwitch",
818
+ "noImplicitAny",
819
+ "noImplicitOverride",
820
+ "noImplicitReturns",
821
+ "noImplicitThis",
822
+ "noPropertyAccessFromIndexSignature",
823
+ "noUncheckedIndexedAccess",
824
+ "noUnusedLocals",
825
+ "noUnusedParameters",
826
+ "useUnknownInCatchVariables",
827
+ /* Emit */
828
+ "declaration",
829
+ "declarationDir",
830
+ "declarationMap",
831
+ "downlevelIteration",
832
+ "emitBOM",
833
+ "emitDeclarationOnly",
834
+ "importHelpers",
835
+ "importsNotUsedAsValues",
836
+ "inlineSourceMap",
837
+ "inlineSources",
838
+ "mapRoot",
839
+ "newLine",
840
+ "noEmit",
841
+ "noEmitHelpers",
842
+ "noEmitOnError",
843
+ "outDir",
844
+ "outFile",
845
+ "preserveConstEnums",
846
+ "preserveValueImports",
847
+ "removeComments",
848
+ "sourceMap",
849
+ "sourceRoot",
850
+ "stripInternal",
851
+ /* Interop Constraints */
852
+ "allowSyntheticDefaultImports",
853
+ "esModuleInterop",
854
+ "forceConsistentCasingInFileNames",
855
+ "isolatedDeclarations",
856
+ "isolatedModules",
857
+ "preserveSymlinks",
858
+ "verbatimModuleSyntax",
859
+ /* Completeness */
860
+ "skipDefaultLibCheck",
861
+ "skipLibCheck"
862
+ ],
863
+ pathPattern: "^compilerOptions$"
864
+ }
865
+ ]
866
+ }
867
+ }
868
+ ];
869
+ }
870
+
871
+ // src/configs/test.ts
872
+ var _pluginTest;
873
+ async function test(options = {}) {
874
+ const { files = GLOB_TESTS, isInEditor = false, overrides = {} } = options;
875
+ const [pluginVitest, pluginNoOnlyTests] = await Promise.all([
876
+ interopDefault(import("eslint-plugin-vitest")),
877
+ interopDefault(import("eslint-plugin-no-only-tests"))
878
+ ]);
879
+ _pluginTest = _pluginTest || {
880
+ ...pluginVitest,
881
+ rules: {
882
+ ...pluginVitest.rules,
883
+ ...pluginNoOnlyTests.rules
884
+ }
885
+ };
886
+ return [
887
+ {
888
+ files,
889
+ name: "test",
890
+ plugins: {
891
+ test: _pluginTest
892
+ },
893
+ rules: {
894
+ "test/consistent-test-it": ["error", { fn: "it", withinDescribe: "it" }],
895
+ "test/no-identical-title": "error",
896
+ "test/no-import-node-test": "error",
897
+ "test/no-only-tests": isInEditor ? "off" : "error",
898
+ "test/prefer-hooks-in-order": "error",
899
+ "test/prefer-lowercase-title": "error",
900
+ "@typescript-eslint/explicit-function-return-type": "off",
901
+ ...overrides
902
+ }
903
+ }
904
+ ];
905
+ }
906
+
907
+ // src/configs/typescript.ts
908
+ async function typescript(options = {}) {
909
+ const { componentExts = [], overrides = {}, parserOptions = {}, type = "app" } = options;
910
+ const files = options.files ?? [GLOB_TS, GLOB_TSX, ...componentExts.map((ext) => `**/*.${ext}`)];
911
+ const filesTypeAware = options.filesTypeAware ?? [GLOB_TS, GLOB_TSX];
912
+ const ignoresTypeAware = options.ignoresTypeAware ?? [`${GLOB_MARKDOWN}/**`, GLOB_ASTRO_TS];
913
+ const tsconfigPath = options?.tsconfigPath;
914
+ const isTypeAware = !!tsconfigPath;
915
+ const [pluginTs, parserTs] = await Promise.all([
916
+ interopDefault(import("@typescript-eslint/eslint-plugin")),
917
+ interopDefault(import("@typescript-eslint/parser"))
918
+ ]);
919
+ function makeParser(typeAware, files2, ignores2) {
920
+ return {
921
+ files: files2,
922
+ ...ignores2 ? { ignores: ignores2 } : {},
923
+ languageOptions: {
924
+ parser: parserTs,
925
+ parserOptions: {
926
+ extraFileExtensions: componentExts.map((ext) => `.${ext}`),
927
+ sourceType: "module",
928
+ ...typeAware ? {
929
+ projectService: {
930
+ allowDefaultProject: ["./*.js"],
931
+ defaultProject: tsconfigPath
932
+ },
933
+ tsconfigRootDir: process.cwd()
934
+ } : {},
935
+ ...parserOptions
936
+ }
937
+ },
938
+ name: `typescript/${typeAware ? "type-aware-parser" : "parser"}`
939
+ };
940
+ }
941
+ return [
942
+ {
943
+ // Install the plugins without globs, so they can be configured separately.
944
+ name: "typescript/setup",
945
+ plugins: {
946
+ "@typescript-eslint": pluginTs
947
+ }
948
+ },
949
+ // assign type-aware parser for type-aware files and type-unaware parser for the rest
950
+ ...isTypeAware ? [makeParser(true, filesTypeAware, ignoresTypeAware), makeParser(false, files, filesTypeAware)] : [makeParser(false, files)],
951
+ {
952
+ files,
953
+ name: "typescript/rules",
954
+ rules: {
955
+ ...pluginTs.configs["eslint-recommended"].overrides[0].rules,
956
+ ...pluginTs.configs.strict.rules,
957
+ "@typescript-eslint/consistent-type-assertions": "error",
958
+ "@typescript-eslint/consistent-type-definitions": "off",
959
+ "@typescript-eslint/consistent-type-imports": [
960
+ "error",
961
+ { disallowTypeAnnotations: false, prefer: "type-imports", fixStyle: "inline-type-imports" }
962
+ ],
963
+ "@typescript-eslint/method-signature-style": "error",
964
+ "@typescript-eslint/no-dynamic-delete": "off",
965
+ "@typescript-eslint/no-explicit-any": "off",
966
+ "@typescript-eslint/no-import-type-side-effects": "error",
967
+ "@typescript-eslint/no-invalid-void-type": "off",
968
+ "@typescript-eslint/no-non-null-assertion": "off",
969
+ "@typescript-eslint/no-require-imports": "error",
970
+ "@typescript-eslint/triple-slash-reference": "off",
971
+ "@typescript-eslint/unified-signatures": "off",
972
+ // handled by unused-imports/no-unused-imports
973
+ "@typescript-eslint/no-unused-vars": "off",
974
+ "no-dupe-class-members": "off",
975
+ "@typescript-eslint/no-dupe-class-members": "error",
976
+ "no-invalid-this": "off",
977
+ "@typescript-eslint/no-invalid-this": "error",
978
+ "no-redeclare": "off",
979
+ "@typescript-eslint/no-redeclare": "error",
980
+ "no-unused-expressions": "off",
981
+ "@typescript-eslint/no-unused-expressions": ["error", { allowShortCircuit: true, allowTernary: true, allowTaggedTemplates: true }],
982
+ "no-use-before-define": "off",
983
+ "@typescript-eslint/no-use-before-define": "error",
984
+ ...type === "lib" ? {
985
+ "@typescript-eslint/explicit-function-return-type": [
986
+ "error",
987
+ {
988
+ allowExpressions: true,
989
+ allowHigherOrderFunctions: true,
990
+ allowIIFEs: true
991
+ }
992
+ ]
993
+ } : {},
994
+ ...overrides
995
+ }
996
+ },
997
+ ...isTypeAware ? [
998
+ {
999
+ files: filesTypeAware,
1000
+ ignores: ignoresTypeAware,
1001
+ name: "typescript/rules-type-aware",
1002
+ rules: {
1003
+ ...tsconfigPath ? {
1004
+ ...pluginTs.configs["recommended-type-checked-only"].rules,
1005
+ "@typescript-eslint/no-confusing-void-expression": "error",
1006
+ "@typescript-eslint/promise-function-async": "error",
1007
+ "@typescript-eslint/restrict-template-expressions": "off",
1008
+ "@typescript-eslint/strict-boolean-expressions": "off",
1009
+ "dot-notation": "off",
1010
+ "@typescript-eslint/dot-notation": ["error", { allowKeywords: true }],
1011
+ "no-throw-literal": "off",
1012
+ "@typescript-eslint/only-throw-error": "error"
1013
+ } : {},
1014
+ ...overrides
1015
+ }
1016
+ }
1017
+ ] : [],
1018
+ {
1019
+ files: ["**/*.d.?([cm])ts"],
1020
+ name: "typescript/disables/dts",
1021
+ rules: {
1022
+ "eslint-comments/no-unlimited-disable": "off",
1023
+ "import/no-duplicates": "off",
1024
+ "no-restricted-syntax": "off",
1025
+ "unused-imports/no-unused-vars": "off"
1026
+ }
1027
+ },
1028
+ {
1029
+ files: ["**/*.{test,spec}.ts?(x)"],
1030
+ name: "typescript/disables/test",
1031
+ rules: {
1032
+ "no-unused-expressions": "off"
1033
+ }
1034
+ },
1035
+ {
1036
+ files: ["**/*.js", "**/*.cjs"],
1037
+ name: "typescript/disables/cjs",
1038
+ rules: {
1039
+ "@typescript-eslint/no-require-imports": "off",
1040
+ "@typescript-eslint/no-var-requires": "off"
1041
+ }
1042
+ }
1043
+ ];
1044
+ }
1045
+
1046
+ // src/configs/unicorn.ts
1047
+ var import_eslint_plugin_unicorn = __toESM(require("eslint-plugin-unicorn"), 1);
1048
+ function unicorn() {
1049
+ return [
1050
+ {
1051
+ name: "unicorn",
1052
+ plugins: {
1053
+ unicorn: import_eslint_plugin_unicorn.default
1054
+ },
1055
+ rules: {
1056
+ ...import_eslint_plugin_unicorn.default.configs["flat/recommended"].rules,
1057
+ "unicorn/consistent-function-scoping": "off",
1058
+ "unicorn/filename-case": "off",
1059
+ "unicorn/no-array-callback-reference": "off",
1060
+ "unicorn/no-null": "off",
1061
+ "unicorn/prefer-string-replace-all": "off",
1062
+ "unicorn/prefer-top-level-await": "off",
1063
+ "unicorn/prevent-abbreviations": "off"
1064
+ }
1065
+ }
1066
+ ];
1067
+ }
1068
+
1069
+ // src/configs/unocss.ts
1070
+ async function unocss() {
1071
+ const pluginUnoCSS = await interopDefault(import("@unocss/eslint-plugin"));
1072
+ return [
1073
+ {
1074
+ ...pluginUnoCSS.configs.flat,
1075
+ name: "unocss"
1076
+ }
1077
+ ];
1078
+ }
1079
+
1080
+ // src/configs/vue.ts
1081
+ async function vue(options = {}) {
1082
+ const { files = [GLOB_VUE], overrides = {}, vueVersion = 3 } = options;
1083
+ const [pluginVue, parserVue] = await Promise.all([
1084
+ interopDefault(import("eslint-plugin-vue")),
1085
+ interopDefault(import("vue-eslint-parser"))
1086
+ ]);
1087
+ return [
1088
+ {
1089
+ files,
1090
+ languageOptions: {
1091
+ parser: parserVue,
1092
+ globals: {
1093
+ computed: "readonly",
1094
+ defineEmits: "readonly",
1095
+ defineExpose: "readonly",
1096
+ defineProps: "readonly",
1097
+ onMounted: "readonly",
1098
+ onUnmounted: "readonly",
1099
+ reactive: "readonly",
1100
+ ref: "readonly",
1101
+ shallowReactive: "readonly",
1102
+ shallowRef: "readonly",
1103
+ toRef: "readonly",
1104
+ toRefs: "readonly",
1105
+ watch: "readonly",
1106
+ watchEffect: "readonly"
1107
+ },
1108
+ parserOptions: {
1109
+ ecmaFeatures: {
1110
+ jsx: true
1111
+ },
1112
+ extraFileExtensions: [".vue"],
1113
+ parser: options.typescript ? await interopDefault(import("@typescript-eslint/parser")) : null,
1114
+ sourceType: "module"
1115
+ }
1116
+ },
1117
+ name: "vue",
1118
+ processor: pluginVue.processors[".vue"],
1119
+ plugins: {
1120
+ vue: pluginVue
1121
+ },
1122
+ rules: {
1123
+ ...pluginVue.configs.base.rules,
1124
+ ...vueVersion === 2 ? {
1125
+ ...pluginVue.configs.essential.rules,
1126
+ ...pluginVue.configs["strongly-recommended"].rules,
1127
+ ...pluginVue.configs.recommended.rules
1128
+ } : {
1129
+ ...pluginVue.configs["vue3-essential"].rules,
1130
+ ...pluginVue.configs["vue3-strongly-recommended"].rules,
1131
+ ...pluginVue.configs["vue3-recommended"].rules
1132
+ },
1133
+ "vue/component-name-in-template-casing": ["error", "PascalCase"],
1134
+ "vue/component-options-name-casing": ["error", "PascalCase"],
1135
+ "vue/custom-event-name-casing": ["error", "camelCase"],
1136
+ "vue/define-macros-order": [
1137
+ "error",
1138
+ {
1139
+ order: ["defineOptions", "defineModel", "defineProps", "defineEmits", "defineSlots"]
1140
+ }
1141
+ ],
1142
+ "vue/dot-notation": "error",
1143
+ "vue/eqeqeq": ["error", "smart"],
1144
+ "vue/html-comment-content-spacing": ["error", "always", { exceptions: ["-"] }],
1145
+ "vue/no-constant-condition": "error",
1146
+ "vue/no-empty-pattern": "error",
1147
+ "vue/no-irregular-whitespace": "error",
1148
+ "vue/no-loss-of-precision": "error",
1149
+ "vue/no-restricted-syntax": ["error", "DebuggerStatement", "LabeledStatement", "WithStatement"],
1150
+ "vue/no-restricted-v-bind": ["error", "/^v-/"],
1151
+ "vue/no-sparse-arrays": "error",
1152
+ "vue/no-unused-refs": "error",
1153
+ "vue/no-useless-v-bind": "error",
1154
+ "vue/no-v-html": "off",
1155
+ "vue/object-shorthand": ["error", "always", { avoidQuotes: true, ignoreConstructors: false }],
1156
+ "vue/prefer-separate-static-class": "error",
1157
+ "vue/prefer-template": "error",
1158
+ "vue/padding-line-between-blocks": ["error", "always"],
1159
+ "vue/component-tags-order": "off",
1160
+ ...overrides
1161
+ }
1162
+ }
1163
+ ];
1164
+ }
1165
+
1166
+ // src/configs/regexp.ts
1167
+ var import_eslint_plugin_regexp = require("eslint-plugin-regexp");
1168
+ function regexp(options = {}) {
1169
+ const config = import_eslint_plugin_regexp.configs["flat/recommended"];
1170
+ return [
1171
+ {
1172
+ ...config,
1173
+ name: "regexp",
1174
+ rules: {
1175
+ ...config.rules,
1176
+ ...options.overrides
1177
+ }
1178
+ }
1179
+ ];
1180
+ }
1181
+
1182
+ // src/factory.ts
1183
+ var import_local_pkg = require("local-pkg");
1184
+ var import_eslint_flat_config_utils = require("eslint-flat-config-utils");
1185
+ var flatConfigProps = [
1186
+ "name",
1187
+ "files",
1188
+ "ignores",
1189
+ "languageOptions",
1190
+ "linterOptions",
1191
+ "processor",
1192
+ "plugins",
1193
+ "rules",
1194
+ "settings"
1195
+ ];
1196
+ var VuePackages = ["vue", "nuxt", "vitepress", "@slidev/cli"];
1197
+ var factoryConfig = function(options = {}, ...userConfigs) {
1198
+ const {
1199
+ componentExts = [],
1200
+ formatters: enableFormatters = true,
1201
+ gitignore: enableGitignore = true,
1202
+ isInEditor = isInEditorEnv(),
1203
+ jsonc: enableJSONC = true,
1204
+ regexp: enableRegexp = true,
1205
+ test: enableTest = true,
1206
+ typescript: enableTypeScript = (0, import_local_pkg.isPackageExists)("typescript"),
1207
+ unocss: enableUnoCSS = (0, import_local_pkg.isPackageExists)("unocss"),
1208
+ vue: enableVue = VuePackages.some((i) => (0, import_local_pkg.isPackageExists)(i))
1209
+ } = options;
1210
+ const configs2 = [];
1211
+ if (enableGitignore) {
1212
+ if (typeof enableGitignore === "boolean") {
1213
+ configs2.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r({ strict: false })]));
1214
+ } else {
1215
+ configs2.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r(enableGitignore)]));
1216
+ }
1217
+ }
1218
+ configs2.push(
1219
+ comments(),
1220
+ ignores(),
1221
+ imports(),
1222
+ javascript({
1223
+ isInEditor,
1224
+ overrides: options.javascript?.overrides
1225
+ }),
1226
+ node(),
1227
+ unicorn()
1228
+ );
1229
+ if (enableVue) {
1230
+ componentExts.push("vue");
1231
+ }
1232
+ if (enableTypeScript) {
1233
+ configs2.push(
1234
+ typescript({
1235
+ ...typeof enableTypeScript === "boolean" ? {} : enableTypeScript || {},
1236
+ componentExts,
1237
+ type: options.type
1238
+ })
1239
+ );
1240
+ }
1241
+ if (enableRegexp) {
1242
+ configs2.push(regexp(typeof enableRegexp === "boolean" ? {} : enableRegexp));
1243
+ }
1244
+ if (enableTest) {
1245
+ configs2.push(
1246
+ test({
1247
+ isInEditor,
1248
+ overrides: typeof enableTest === "boolean" ? {} : enableTest?.overrides
1249
+ })
1250
+ );
1251
+ }
1252
+ if (enableVue) {
1253
+ configs2.push(
1254
+ vue({
1255
+ ...typeof enableVue === "boolean" ? {} : enableVue || {},
1256
+ typescript: !!enableTypeScript
1257
+ })
1258
+ );
1259
+ }
1260
+ if (enableUnoCSS) {
1261
+ configs2.push(unocss());
1262
+ }
1263
+ if (enableJSONC) {
1264
+ configs2.push(jsonc(typeof enableJSONC === "boolean" ? {} : enableJSONC), sortPackageJson(), sortTsconfig());
1265
+ }
1266
+ if (enableFormatters) {
1267
+ configs2.push(formatters(enableFormatters));
1268
+ }
1269
+ const fusedConfig = flatConfigProps.reduce((acc, key) => {
1270
+ if (key in options) acc[key] = options[key];
1271
+ return acc;
1272
+ }, {});
1273
+ if (Object.keys(fusedConfig).length > 0) configs2.push([fusedConfig]);
1274
+ let composer = new import_eslint_flat_config_utils.FlatConfigComposer();
1275
+ composer = composer.append(...configs2, ...userConfigs);
1276
+ return composer;
1277
+ };
1278
+ // Annotate the CommonJS export names for ESM import in node:
1279
+ 0 && (module.exports = {
1280
+ GLOB_ALL_SRC,
1281
+ GLOB_ASTRO,
1282
+ GLOB_ASTRO_TS,
1283
+ GLOB_CSS,
1284
+ GLOB_EXCLUDE,
1285
+ GLOB_GRAPHQL,
1286
+ GLOB_HTML,
1287
+ GLOB_JS,
1288
+ GLOB_JSON,
1289
+ GLOB_JSON5,
1290
+ GLOB_JSONC,
1291
+ GLOB_JSX,
1292
+ GLOB_LESS,
1293
+ GLOB_MARKDOWN,
1294
+ GLOB_MARKDOWN_CODE,
1295
+ GLOB_MARKDOWN_IN_MARKDOWN,
1296
+ GLOB_POSTCSS,
1297
+ GLOB_SCSS,
1298
+ GLOB_SRC,
1299
+ GLOB_SRC_EXT,
1300
+ GLOB_STYLE,
1301
+ GLOB_SVELTE,
1302
+ GLOB_TESTS,
1303
+ GLOB_TOML,
1304
+ GLOB_TS,
1305
+ GLOB_TSX,
1306
+ GLOB_VUE,
1307
+ GLOB_XML,
1308
+ GLOB_YAML,
1309
+ combine,
1310
+ comments,
1311
+ factoryConfig,
1312
+ formatters,
1313
+ ignores,
1314
+ imports,
1315
+ interopDefault,
1316
+ isInEditorEnv,
1317
+ javascript,
1318
+ jsonc,
1319
+ node,
1320
+ parserPlain,
1321
+ regexp,
1322
+ sortPackageJson,
1323
+ sortTsconfig,
1324
+ test,
1325
+ toArray,
1326
+ typescript,
1327
+ unicorn,
1328
+ unocss,
1329
+ vue
1330
+ });