@lincy/eslint-config 2.5.4 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,1323 @@
1
+ // src/factory.ts
2
+ import process2 from "process";
3
+
4
+ // node_modules/.pnpm/local-pkg@0.4.3/node_modules/local-pkg/index.mjs
5
+ import { dirname, join } from "path";
6
+ import { existsSync, promises as fs, readFileSync } from "fs";
7
+ import { createRequire } from "module";
8
+ var _require = createRequire(import.meta.url);
9
+ function isPackageExists(name, options) {
10
+ return !!resolvePackage(name, options);
11
+ }
12
+ function getPackageJsonPath(name, options) {
13
+ const entry = resolvePackage(name, options);
14
+ if (!entry)
15
+ return;
16
+ return searchPackageJSON(entry);
17
+ }
18
+ function getPackageInfoSync(name, options) {
19
+ const packageJsonPath = getPackageJsonPath(name, options);
20
+ if (!packageJsonPath)
21
+ return;
22
+ const pkg2 = JSON.parse(readFileSync(packageJsonPath, "utf8"));
23
+ return {
24
+ name,
25
+ version: pkg2.version,
26
+ rootPath: dirname(packageJsonPath),
27
+ packageJsonPath,
28
+ packageJson: pkg2
29
+ };
30
+ }
31
+ function resolvePackage(name, options = {}) {
32
+ try {
33
+ return _require.resolve(`${name}/package.json`, options);
34
+ } catch {
35
+ }
36
+ try {
37
+ return _require.resolve(name, options);
38
+ } catch (e) {
39
+ if (e.code !== "MODULE_NOT_FOUND")
40
+ console.error(e);
41
+ return false;
42
+ }
43
+ }
44
+ function searchPackageJSON(dir) {
45
+ let packageJsonPath;
46
+ while (true) {
47
+ if (!dir)
48
+ return;
49
+ const newDir = dirname(dir);
50
+ if (newDir === dir)
51
+ return;
52
+ dir = newDir;
53
+ packageJsonPath = join(dir, "package.json");
54
+ if (existsSync(packageJsonPath))
55
+ break;
56
+ }
57
+ return packageJsonPath;
58
+ }
59
+
60
+ // src/flags.ts
61
+ var OFF = 0;
62
+
63
+ // src/plugins.ts
64
+ import { default as default2 } from "eslint-plugin-antfu";
65
+ import { default as default3 } from "eslint-plugin-eslint-comments";
66
+ import { default as default4 } from "eslint-plugin-i";
67
+ import { default as default5 } from "eslint-plugin-jsdoc";
68
+ import { default as default6 } from "eslint-plugin-jsonc";
69
+ import { default as default7 } from "eslint-plugin-markdown";
70
+ import { default as default8 } from "eslint-plugin-n";
71
+ import { default as default9 } from "@stylistic/eslint-plugin-js";
72
+ import { default as default10 } from "@stylistic/eslint-plugin-ts";
73
+ import { default as default11 } from "@typescript-eslint/eslint-plugin";
74
+ import { default as default12 } from "eslint-plugin-unicorn";
75
+ import { default as default13 } from "eslint-plugin-unused-imports";
76
+ import { default as default14 } from "eslint-plugin-vue";
77
+ import { default as default15 } from "eslint-plugin-yml";
78
+ import { default as default16 } from "eslint-plugin-no-only-tests";
79
+ import { default as default17 } from "@typescript-eslint/parser";
80
+ import { default as default18 } from "vue-eslint-parser";
81
+ import { default as default19 } from "yaml-eslint-parser";
82
+ import { default as default20 } from "jsonc-eslint-parser";
83
+
84
+ // src/configs/comments.ts
85
+ var comments = [
86
+ {
87
+ plugins: {
88
+ "eslint-comments": default3
89
+ },
90
+ rules: {
91
+ ...default3.configs.recommended.rules,
92
+ "eslint-comments/disable-enable-pair": OFF
93
+ }
94
+ }
95
+ ];
96
+
97
+ // src/globs.ts
98
+ var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
99
+ var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
100
+ var GLOB_TS = "**/*.?([cm])ts";
101
+ var GLOB_TSX = "**/*.?([cm])tsx";
102
+ var GLOB_JSON = "**/*.json";
103
+ var GLOB_JSON5 = "**/*.json5";
104
+ var GLOB_JSONC = "**/*.jsonc";
105
+ var GLOB_MARKDOWN = "**/*.md";
106
+ var GLOB_VUE = "**/*.vue";
107
+ var GLOB_YAML = "**/*.y?(a)ml";
108
+ var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
109
+ var GLOB_TESTS = [
110
+ `**/__tests__/**/*.${GLOB_SRC_EXT}`,
111
+ `**/*.spec.${GLOB_SRC_EXT}`,
112
+ `**/*.test.${GLOB_SRC_EXT}`
113
+ ];
114
+ var GLOB_EXCLUDE = [
115
+ "**/node_modules",
116
+ "**/dist",
117
+ "**/package-lock.json",
118
+ "**/yarn.lock",
119
+ "**/pnpm-lock.yaml",
120
+ "**/output",
121
+ "**/coverage",
122
+ "**/temp",
123
+ "**/.vitepress/cache",
124
+ "**/.nuxt",
125
+ "**/.vercel",
126
+ "**/.changeset",
127
+ "**/.idea",
128
+ "**/.output",
129
+ "**/.vite-inspect",
130
+ "**/CHANGELOG*.md",
131
+ "**/*.min.*",
132
+ "**/LICENSE*",
133
+ "**/__snapshots__",
134
+ "**/auto-import?(s).d.ts",
135
+ "**/components.d.ts"
136
+ ];
137
+
138
+ // src/configs/ignores.ts
139
+ var ignores = [
140
+ { ignores: GLOB_EXCLUDE }
141
+ ];
142
+
143
+ // src/configs/imports.ts
144
+ var imports = [
145
+ {
146
+ plugins: {
147
+ import: default4
148
+ },
149
+ rules: {
150
+ "import/export": "error",
151
+ "import/first": "error",
152
+ "import/newline-after-import": ["error", { considerComments: true, count: 1 }],
153
+ "import/no-duplicates": "error",
154
+ "import/no-mutable-exports": "error",
155
+ "import/no-named-default": "error",
156
+ "import/no-self-import": "error",
157
+ "import/no-webpack-loader-syntax": "error",
158
+ "import/order": "error"
159
+ }
160
+ }
161
+ ];
162
+
163
+ // src/configs/javascript.ts
164
+ import globals from "globals";
165
+ function javascript(options = {}) {
166
+ return [
167
+ {
168
+ languageOptions: {
169
+ ecmaVersion: 2022,
170
+ globals: {
171
+ ...globals.browser,
172
+ ...globals.es2021,
173
+ ...globals.node,
174
+ document: "readonly",
175
+ navigator: "readonly",
176
+ window: "readonly"
177
+ },
178
+ parserOptions: {
179
+ ecmaFeatures: {
180
+ jsx: true
181
+ },
182
+ ecmaVersion: 2022,
183
+ sourceType: "module"
184
+ },
185
+ sourceType: "module"
186
+ },
187
+ plugins: {
188
+ "antfu": default2,
189
+ "unused-imports": default13
190
+ },
191
+ rules: {
192
+ "accessor-pairs": ["error", { enforceForClassMembers: true, setWithoutGet: true }],
193
+ "antfu/import-dedupe": "error",
194
+ "antfu/no-import-node-modules-by-path": "error",
195
+ "antfu/top-level-function": "error",
196
+ "array-callback-return": "error",
197
+ "arrow-parens": ["error", "as-needed", { requireForBlockBody: true }],
198
+ "block-scoped-var": "error",
199
+ "camelcase": OFF,
200
+ "complexity": OFF,
201
+ "consistent-return": OFF,
202
+ "constructor-super": "error",
203
+ "default-case-last": "error",
204
+ "dot-notation": ["error", { allowKeywords: true }],
205
+ "eol-last": "error",
206
+ "eqeqeq": ["error", "smart"],
207
+ "max-statements-per-line": ["error", { max: 1 }],
208
+ "new-cap": ["error", { capIsNew: false, newIsCap: true, properties: true }],
209
+ "new-parens": "error",
210
+ "no-alert": "warn",
211
+ "no-array-constructor": "error",
212
+ "no-async-promise-executor": "error",
213
+ "no-caller": "error",
214
+ "no-case-declarations": "error",
215
+ "no-class-assign": "error",
216
+ "no-compare-neg-zero": "error",
217
+ "no-cond-assign": ["error", "always"],
218
+ "no-console": ["error", { allow: ["warn", "error"] }],
219
+ "no-const-assign": "error",
220
+ "no-constant-condition": "warn",
221
+ "no-control-regex": "error",
222
+ "no-debugger": "error",
223
+ "no-delete-var": "error",
224
+ "no-dupe-args": "error",
225
+ "no-dupe-class-members": "error",
226
+ "no-dupe-keys": "error",
227
+ "no-duplicate-case": "error",
228
+ "no-empty": ["error", { allowEmptyCatch: true }],
229
+ "no-empty-character-class": "error",
230
+ "no-empty-pattern": "error",
231
+ "no-eval": "error",
232
+ "no-ex-assign": "error",
233
+ "no-extend-native": "error",
234
+ "no-extra-bind": "error",
235
+ "no-extra-boolean-cast": "error",
236
+ "no-extra-parens": ["error", "functions"],
237
+ "no-fallthrough": "error",
238
+ "no-floating-decimal": "error",
239
+ "no-func-assign": "error",
240
+ "no-global-assign": "error",
241
+ "no-implied-eval": "error",
242
+ "no-import-assign": "error",
243
+ "no-invalid-regexp": "error",
244
+ "no-invalid-this": "error",
245
+ "no-irregular-whitespace": "error",
246
+ "no-iterator": "error",
247
+ "no-labels": ["error", { allowLoop: false, allowSwitch: false }],
248
+ "no-lone-blocks": "error",
249
+ "no-loss-of-precision": "error",
250
+ "no-misleading-character-class": "error",
251
+ "no-mixed-operators": ["error", {
252
+ allowSamePrecedence: true,
253
+ groups: [
254
+ ["==", "!=", "===", "!==", ">", ">=", "<", "<="],
255
+ ["&&", "||"],
256
+ ["in", "instanceof"]
257
+ ]
258
+ }],
259
+ "no-multi-str": "error",
260
+ "no-new": "error",
261
+ "no-new-func": "error",
262
+ "no-new-object": "error",
263
+ "no-new-symbol": "error",
264
+ "no-new-wrappers": "error",
265
+ "no-obj-calls": "error",
266
+ "no-octal": "error",
267
+ "no-octal-escape": "error",
268
+ "no-param-reassign": OFF,
269
+ "no-proto": "error",
270
+ "no-prototype-builtins": "error",
271
+ "no-redeclare": ["error", { builtinGlobals: false }],
272
+ "no-regex-spaces": "error",
273
+ "no-restricted-globals": [
274
+ "error",
275
+ { message: "Use `globalThis` instead.", name: "global" },
276
+ { message: "Use `globalThis` instead.", name: "self" }
277
+ ],
278
+ "no-restricted-properties": [
279
+ "error",
280
+ { message: "Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.", property: "__proto__" },
281
+ { message: "Use `Object.defineProperty` instead.", property: "__defineGetter__" },
282
+ { message: "Use `Object.defineProperty` instead.", property: "__defineSetter__" },
283
+ { message: "Use `Object.getOwnPropertyDescriptor` instead.", property: "__lookupGetter__" },
284
+ { message: "Use `Object.getOwnPropertyDescriptor` instead.", property: "__lookupSetter__" }
285
+ ],
286
+ "no-restricted-syntax": [
287
+ "error",
288
+ "DebuggerStatement",
289
+ "LabeledStatement",
290
+ "WithStatement"
291
+ ],
292
+ "no-return-assign": OFF,
293
+ "no-return-await": OFF,
294
+ "no-self-assign": ["error", { props: true }],
295
+ "no-self-compare": "error",
296
+ "no-sequences": "error",
297
+ "no-shadow-restricted-names": "error",
298
+ "no-sparse-arrays": "error",
299
+ "no-template-curly-in-string": "error",
300
+ "no-this-before-super": "error",
301
+ "no-throw-literal": "error",
302
+ "no-undef": "error",
303
+ "no-undef-init": "error",
304
+ "no-unexpected-multiline": "error",
305
+ "no-unmodified-loop-condition": "error",
306
+ "no-unneeded-ternary": ["error", { defaultAssignment: false }],
307
+ "no-unreachable": "error",
308
+ "no-unreachable-loop": "error",
309
+ "no-unsafe-finally": "error",
310
+ "no-unsafe-negation": "error",
311
+ "no-unused-expressions": ["error", {
312
+ allowShortCircuit: true,
313
+ allowTaggedTemplates: true,
314
+ allowTernary: true
315
+ }],
316
+ "no-unused-vars": ["error", {
317
+ args: "none",
318
+ caughtErrors: "none",
319
+ ignoreRestSiblings: true,
320
+ vars: "all"
321
+ }],
322
+ "no-use-before-define": ["error", { classes: false, functions: false, variables: true }],
323
+ "no-useless-backreference": "error",
324
+ "no-useless-call": "error",
325
+ "no-useless-catch": "error",
326
+ "no-useless-computed-key": "error",
327
+ "no-useless-constructor": "error",
328
+ "no-useless-escape": OFF,
329
+ "no-useless-rename": "error",
330
+ "no-useless-return": "error",
331
+ "no-var": "error",
332
+ "no-void": "error",
333
+ "no-with": "error",
334
+ "object-shorthand": [
335
+ "error",
336
+ "always",
337
+ {
338
+ avoidQuotes: true,
339
+ ignoreConstructors: false
340
+ }
341
+ ],
342
+ "one-var": ["error", { initialized: "never" }],
343
+ "prefer-arrow-callback": [
344
+ "error",
345
+ {
346
+ allowNamedFunctions: false,
347
+ allowUnboundThis: true
348
+ }
349
+ ],
350
+ "prefer-const": [
351
+ "error",
352
+ {
353
+ destructuring: "all",
354
+ ignoreReadBeforeAssign: true
355
+ }
356
+ ],
357
+ "prefer-exponentiation-operator": "error",
358
+ "prefer-promise-reject-errors": "error",
359
+ "prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
360
+ "prefer-rest-params": "error",
361
+ "prefer-spread": "error",
362
+ "prefer-template": "error",
363
+ "quote-props": ["error", "consistent-as-needed"],
364
+ "require-await": OFF,
365
+ "sort-imports": [
366
+ "error",
367
+ {
368
+ allowSeparatedGroups: false,
369
+ ignoreCase: false,
370
+ ignoreDeclarationSort: true,
371
+ ignoreMemberSort: false,
372
+ memberSyntaxSortOrder: ["none", "all", "multiple", "single"]
373
+ }
374
+ ],
375
+ "symbol-description": "error",
376
+ "unicode-bom": ["error", "never"],
377
+ "unused-imports/no-unused-imports": options.isInEditor ? OFF : "error",
378
+ "unused-imports/no-unused-vars": [
379
+ "warn",
380
+ { args: "after-used", argsIgnorePattern: "^_", vars: "all", varsIgnorePattern: "^_" }
381
+ ],
382
+ "use-isnan": ["error", { enforceForIndexOf: true, enforceForSwitchCase: true }],
383
+ "valid-typeof": ["error", { requireStringLiterals: true }],
384
+ "vars-on-top": "error",
385
+ "wrap-iife": ["error", "any", { functionPrototypeMethods: true }],
386
+ "yoda": ["error", "never"]
387
+ }
388
+ },
389
+ {
390
+ files: ["scripts/**/*.*", "cli.*"],
391
+ rules: {
392
+ "no-console": OFF
393
+ }
394
+ }
395
+ ];
396
+ }
397
+
398
+ // src/configs/jsdoc.ts
399
+ var jsdoc = [
400
+ {
401
+ plugins: {
402
+ jsdoc: default5
403
+ },
404
+ rules: {
405
+ ...default5.configs["flat/recommended-typescript"].rules,
406
+ "jsdoc/check-tag-names": OFF,
407
+ "jsdoc/check-values": OFF,
408
+ "jsdoc/no-undefined-types": OFF,
409
+ "jsdoc/require-jsdoc": OFF,
410
+ "jsdoc/require-param": OFF,
411
+ "jsdoc/require-param-description": OFF,
412
+ "jsdoc/require-param-type": OFF,
413
+ "jsdoc/require-returns": OFF,
414
+ "jsdoc/require-returns-type": OFF,
415
+ "jsdoc/require-throws": OFF,
416
+ "jsdoc/require-yields": OFF,
417
+ "jsdoc/tag-lines": OFF
418
+ }
419
+ }
420
+ ];
421
+
422
+ // src/configs/jsonc.ts
423
+ var jsonc = [
424
+ {
425
+ files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
426
+ languageOptions: {
427
+ parser: default20
428
+ },
429
+ plugins: {
430
+ jsonc: default6
431
+ },
432
+ rules: {
433
+ ...default6.configs["recommended-with-jsonc"].rules,
434
+ "jsonc/array-bracket-spacing": ["error", "never"],
435
+ "jsonc/comma-dangle": ["error", "never"],
436
+ "jsonc/comma-style": ["error", "last"],
437
+ "jsonc/indent": ["error", 2],
438
+ "jsonc/key-spacing": ["error", { afterColon: true, beforeColon: false }],
439
+ "jsonc/no-octal-escape": "error",
440
+ "jsonc/object-curly-newline": ["error", { consistent: true, multiline: true }],
441
+ "jsonc/object-curly-spacing": ["error", "always"],
442
+ "jsonc/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }]
443
+ }
444
+ }
445
+ ];
446
+
447
+ // src/configs/markdown.ts
448
+ function markdown(options = {}) {
449
+ const {
450
+ componentExts = []
451
+ } = options;
452
+ return [
453
+ {
454
+ files: [GLOB_MARKDOWN],
455
+ plugins: {
456
+ markdown: default7
457
+ },
458
+ processor: "markdown/markdown"
459
+ },
460
+ {
461
+ files: [
462
+ GLOB_MARKDOWN_CODE,
463
+ ...componentExts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)
464
+ ],
465
+ languageOptions: {
466
+ parserOptions: {
467
+ ecmaFeatures: {
468
+ impliedStrict: true
469
+ }
470
+ }
471
+ },
472
+ plugins: {
473
+ ts: default11
474
+ },
475
+ rules: {
476
+ ...default7.configs.recommended.overrides[1].rules,
477
+ "antfu/no-cjs-exports": OFF,
478
+ "antfu/no-ts-export-equal": OFF,
479
+ "import/no-unresolved": OFF,
480
+ "no-alert": OFF,
481
+ "no-console": OFF,
482
+ "no-restricted-imports": OFF,
483
+ "no-undef": OFF,
484
+ "no-unused-expressions": OFF,
485
+ "no-unused-vars": OFF,
486
+ "node/prefer-global/process": OFF,
487
+ "ts/comma-dangle": OFF,
488
+ "ts/consistent-type-imports": OFF,
489
+ "ts/no-namespace": OFF,
490
+ "ts/no-redeclare": OFF,
491
+ "ts/no-require-imports": OFF,
492
+ "ts/no-unused-vars": OFF,
493
+ "ts/no-use-before-define": OFF,
494
+ "ts/no-var-requires": OFF,
495
+ "unused-imports/no-unused-imports": OFF,
496
+ "unused-imports/no-unused-vars": OFF
497
+ }
498
+ }
499
+ ];
500
+ }
501
+
502
+ // src/configs/node.ts
503
+ var node = [
504
+ {
505
+ plugins: {
506
+ node: default8
507
+ },
508
+ rules: {
509
+ "node/handle-callback-err": ["error", "^(err|error)$"],
510
+ "node/no-deprecated-api": "error",
511
+ "node/no-exports-assign": "error",
512
+ "node/no-new-require": "error",
513
+ "node/no-path-concat": "error",
514
+ "node/prefer-global/buffer": ["error", "never"],
515
+ "node/prefer-global/process": ["error", "never"],
516
+ "node/process-exit-as-throw": "error"
517
+ }
518
+ }
519
+ ];
520
+
521
+ // src/configs/sort.ts
522
+ var sortPackageJson = [
523
+ {
524
+ files: ["**/package.json"],
525
+ rules: {
526
+ "jsonc/sort-array-values": [
527
+ "error",
528
+ {
529
+ order: { type: "asc" },
530
+ pathPattern: "^files$"
531
+ }
532
+ ],
533
+ "jsonc/sort-keys": [
534
+ "error",
535
+ {
536
+ order: [
537
+ "publisher",
538
+ "name",
539
+ "displayName",
540
+ "type",
541
+ "version",
542
+ "private",
543
+ "packageManager",
544
+ "description",
545
+ "author",
546
+ "license",
547
+ "funding",
548
+ "homepage",
549
+ "repository",
550
+ "bugs",
551
+ "keywords",
552
+ "categories",
553
+ "sideEffects",
554
+ "exports",
555
+ "main",
556
+ "module",
557
+ "unpkg",
558
+ "jsdelivr",
559
+ "types",
560
+ "typesVersions",
561
+ "bin",
562
+ "icon",
563
+ "files",
564
+ "engines",
565
+ "activationEvents",
566
+ "contributes",
567
+ "scripts",
568
+ "peerDependencies",
569
+ "peerDependenciesMeta",
570
+ "dependencies",
571
+ "optionalDependencies",
572
+ "devDependencies",
573
+ "pnpm",
574
+ "overrides",
575
+ "resolutions",
576
+ "husky",
577
+ "simple-git-hooks",
578
+ "lint-staged",
579
+ "eslintConfig"
580
+ ],
581
+ pathPattern: "^$"
582
+ },
583
+ {
584
+ order: { type: "asc" },
585
+ pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies$"
586
+ },
587
+ {
588
+ order: { type: "asc" },
589
+ pathPattern: "^resolutions$"
590
+ },
591
+ {
592
+ order: { type: "asc" },
593
+ pathPattern: "^pnpm.overrides$"
594
+ },
595
+ {
596
+ order: [
597
+ "types",
598
+ "import",
599
+ "require",
600
+ "default"
601
+ ],
602
+ pathPattern: "^exports.*$"
603
+ }
604
+ ]
605
+ }
606
+ }
607
+ ];
608
+ var sortTsconfig = [
609
+ {
610
+ files: ["**/tsconfig.json", "**/tsconfig.*.json"],
611
+ rules: {
612
+ "jsonc/sort-keys": [
613
+ "error",
614
+ {
615
+ order: [
616
+ "extends",
617
+ "compilerOptions",
618
+ "references",
619
+ "files",
620
+ "include",
621
+ "exclude"
622
+ ],
623
+ pathPattern: "^$"
624
+ },
625
+ {
626
+ order: [
627
+ /* Projects */
628
+ "incremental",
629
+ "composite",
630
+ "tsBuildInfoFile",
631
+ "disableSourceOfProjectReferenceRedirect",
632
+ "disableSolutionSearching",
633
+ "disableReferencedProjectLoad",
634
+ /* Language and Environment */
635
+ "target",
636
+ "lib",
637
+ "jsx",
638
+ "experimentalDecorators",
639
+ "emitDecoratorMetadata",
640
+ "jsxFactory",
641
+ "jsxFragmentFactory",
642
+ "jsxImportSource",
643
+ "reactNamespace",
644
+ "noLib",
645
+ "useDefineForClassFields",
646
+ "moduleDetection",
647
+ /* Modules */
648
+ "module",
649
+ "rootDir",
650
+ "moduleResolution",
651
+ "baseUrl",
652
+ "paths",
653
+ "rootDirs",
654
+ "typeRoots",
655
+ "types",
656
+ "allowUmdGlobalAccess",
657
+ "moduleSuffixes",
658
+ "allowImportingTsExtensions",
659
+ "resolvePackageJsonExports",
660
+ "resolvePackageJsonImports",
661
+ "customConditions",
662
+ "resolveJsonModule",
663
+ "allowArbitraryExtensions",
664
+ "noResolve",
665
+ /* JavaScript Support */
666
+ "allowJs",
667
+ "checkJs",
668
+ "maxNodeModuleJsDepth",
669
+ /* Emit */
670
+ "declaration",
671
+ "declarationMap",
672
+ "emitDeclarationOnly",
673
+ "sourceMap",
674
+ "inlineSourceMap",
675
+ "outFile",
676
+ "outDir",
677
+ "removeComments",
678
+ "noEmit",
679
+ "importHelpers",
680
+ "importsNotUsedAsValues",
681
+ "downlevelIteration",
682
+ "sourceRoot",
683
+ "mapRoot",
684
+ "inlineSources",
685
+ "emitBOM",
686
+ "newLine",
687
+ "stripInternal",
688
+ "noEmitHelpers",
689
+ "noEmitOnError",
690
+ "preserveConstEnums",
691
+ "declarationDir",
692
+ "preserveValueImports",
693
+ /* Interop Constraints */
694
+ "isolatedModules",
695
+ "verbatimModuleSyntax",
696
+ "allowSyntheticDefaultImports",
697
+ "esModuleInterop",
698
+ "preserveSymlinks",
699
+ "forceConsistentCasingInFileNames",
700
+ /* Type Checking */
701
+ "strict",
702
+ "strictBindCallApply",
703
+ "strictFunctionTypes",
704
+ "strictNullChecks",
705
+ "strictPropertyInitialization",
706
+ "allowUnreachableCode",
707
+ "allowUnusedLabels",
708
+ "alwaysStrict",
709
+ "exactOptionalPropertyTypes",
710
+ "noFallthroughCasesInSwitch",
711
+ "noImplicitAny",
712
+ "noImplicitOverride",
713
+ "noImplicitReturns",
714
+ "noImplicitThis",
715
+ "noPropertyAccessFromIndexSignature",
716
+ "noUncheckedIndexedAccess",
717
+ "noUnusedLocals",
718
+ "noUnusedParameters",
719
+ "useUnknownInCatchVariables",
720
+ /* Completeness */
721
+ "skipDefaultLibCheck",
722
+ "skipLibCheck"
723
+ ],
724
+ pathPattern: "^compilerOptions$"
725
+ }
726
+ ]
727
+ }
728
+ }
729
+ ];
730
+
731
+ // src/configs/stylistic.ts
732
+ import { packages } from "@eslint-stylistic/metadata";
733
+ var tsPackage = packages.find((i) => i.shortId === "ts");
734
+ var javascriptStylistic = [
735
+ {
736
+ plugins: {
737
+ style: default9
738
+ },
739
+ rules: {
740
+ "antfu/if-newline": "error",
741
+ "comma-dangle": ["error", "always-multiline"],
742
+ "curly": ["error", "multi-or-nest", "consistent"],
743
+ "quotes": ["error", "single"],
744
+ "semi": ["error", "never"],
745
+ "style/array-bracket-spacing": ["error", "never"],
746
+ "style/arrow-spacing": ["error", { after: true, before: true }],
747
+ "style/block-spacing": ["error", "always"],
748
+ "style/brace-style": ["error", "stroustrup", { allowSingleLine: true }],
749
+ "style/comma-spacing": ["error", { after: true, before: false }],
750
+ "style/comma-style": ["error", "last"],
751
+ "style/computed-property-spacing": ["error", "never", { enforceForClassMembers: true }],
752
+ "style/dot-location": ["error", "property"],
753
+ "style/func-call-spacing": OFF,
754
+ "style/generator-star-spacing": OFF,
755
+ "style/indent": ["error", 4, {
756
+ ArrayExpression: 1,
757
+ CallExpression: { arguments: 1 },
758
+ FunctionDeclaration: { body: 1, parameters: 1 },
759
+ FunctionExpression: { body: 1, parameters: 1 },
760
+ ImportDeclaration: 1,
761
+ MemberExpression: 1,
762
+ ObjectExpression: 1,
763
+ SwitchCase: 1,
764
+ VariableDeclarator: 1,
765
+ flatTernaryExpressions: false,
766
+ ignoreComments: false,
767
+ ignoredNodes: [
768
+ "TemplateLiteral *",
769
+ "JSXElement",
770
+ "JSXElement > *",
771
+ "JSXAttribute",
772
+ "JSXIdentifier",
773
+ "JSXNamespacedName",
774
+ "JSXMemberExpression",
775
+ "JSXSpreadAttribute",
776
+ "JSXExpressionContainer",
777
+ "JSXOpeningElement",
778
+ "JSXClosingElement",
779
+ "JSXFragment",
780
+ "JSXOpeningFragment",
781
+ "JSXClosingFragment",
782
+ "JSXText",
783
+ "JSXEmptyExpression",
784
+ "JSXSpreadChild",
785
+ "TSTypeParameterInstantiation",
786
+ "FunctionExpression > .params[decorators.length > 0]",
787
+ "FunctionExpression > .params > :matches(Decorator, :not(:first-child))",
788
+ "ClassBody.body > PropertyDefinition[decorators.length > 0] > .key"
789
+ ],
790
+ offsetTernaryExpressions: true,
791
+ outerIIFEBody: 1
792
+ }],
793
+ "style/key-spacing": ["error", { afterColon: true, beforeColon: false }],
794
+ "style/keyword-spacing": ["error", { after: true, before: true }],
795
+ "style/lines-between-class-members": ["error", "always", { exceptAfterSingleLine: true }],
796
+ "style/multiline-ternary": ["error", "always-multiline"],
797
+ "style/no-mixed-spaces-and-tabs": "error",
798
+ "style/no-multi-spaces": "error",
799
+ "style/no-multiple-empty-lines": ["error", { max: 1, maxBOF: 0, maxEOF: 0 }],
800
+ "style/no-tabs": "error",
801
+ "style/no-trailing-spaces": "error",
802
+ "style/no-whitespace-before-property": "error",
803
+ "style/object-curly-newline": ["error", { consistent: true, multiline: true }],
804
+ "style/object-curly-spacing": ["error", "always"],
805
+ "style/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
806
+ "style/operator-linebreak": ["error", "before"],
807
+ "style/padded-blocks": ["error", { blocks: "never", classes: "never", switches: "never" }],
808
+ "style/rest-spread-spacing": ["error", "never"],
809
+ "style/semi-spacing": ["error", { after: true, before: false }],
810
+ "style/space-before-blocks": ["error", "always"],
811
+ "style/space-before-function-paren": ["error", { anonymous: "always", asyncArrow: "always", named: "never" }],
812
+ "style/space-in-parens": ["error", "never"],
813
+ "style/space-infix-ops": "error",
814
+ "style/space-unary-ops": ["error", { nonwords: false, words: true }],
815
+ "style/spaced-comment": ["error", "always", {
816
+ block: {
817
+ balanced: true,
818
+ exceptions: ["*"],
819
+ markers: ["!"]
820
+ },
821
+ line: {
822
+ exceptions: ["/", "#"],
823
+ markers: ["/"]
824
+ }
825
+ }],
826
+ "style/template-curly-spacing": "error",
827
+ "style/template-tag-spacing": ["error", "never"],
828
+ "style/yield-star-spacing": ["error", "both"]
829
+ }
830
+ }
831
+ ];
832
+ var typescriptStylistic = [
833
+ {
834
+ plugins: {
835
+ "style-ts": default10,
836
+ "ts": default11
837
+ },
838
+ rules: {
839
+ ...stylisticJsToTS(javascriptStylistic[0].rules),
840
+ "comma-dangle": OFF,
841
+ "quotes": OFF,
842
+ "semi": OFF,
843
+ "style-ts/member-delimiter-style": ["error", { multiline: { delimiter: "none" } }],
844
+ "style-ts/type-annotation-spacing": ["error", {}],
845
+ "ts/comma-dangle": ["error", "always-multiline"],
846
+ "ts/quotes": ["error", "single"],
847
+ "ts/semi": ["error", "never"]
848
+ }
849
+ }
850
+ ];
851
+ function stylisticJsToTS(input) {
852
+ return {
853
+ // turn off all stylistic rules from style
854
+ ...Object.fromEntries(
855
+ Object.entries(input).map(([key]) => {
856
+ if (!key.startsWith("style/"))
857
+ return null;
858
+ const basename = key.replace("style/", "");
859
+ if (tsPackage.rules.find((i) => i.name === basename))
860
+ return [key, OFF];
861
+ return null;
862
+ }).filter(Boolean)
863
+ ),
864
+ // rename all stylistic rules from style to style/ts
865
+ ...Object.fromEntries(
866
+ Object.entries(input).map(([key, value]) => {
867
+ if (!key.startsWith("style/"))
868
+ return null;
869
+ const basename = key.replace("style/", "");
870
+ return tsPackage.rules.find((i) => i.name === basename) ? [`style-ts/${basename}`, value] : null;
871
+ }).filter(Boolean)
872
+ )
873
+ };
874
+ }
875
+
876
+ // src/configs/typescript.ts
877
+ import process from "process";
878
+
879
+ // src/utils.ts
880
+ function combine(...configs) {
881
+ return configs.flatMap((config) => Array.isArray(config) ? config : [config]);
882
+ }
883
+ function renameRules(rules, from, to) {
884
+ return Object.fromEntries(
885
+ Object.entries(rules).map(([key, value]) => {
886
+ if (key.startsWith(from))
887
+ return [to + key.slice(from.length), value];
888
+ return [key, value];
889
+ })
890
+ );
891
+ }
892
+
893
+ // src/configs/typescript.ts
894
+ function typescript(options) {
895
+ const {
896
+ componentExts = []
897
+ } = options ?? {};
898
+ return [
899
+ {
900
+ files: [
901
+ GLOB_TS,
902
+ GLOB_TSX,
903
+ ...componentExts.map((ext) => `**/*.${ext}`)
904
+ ],
905
+ languageOptions: {
906
+ parser: default17,
907
+ parserOptions: {
908
+ sourceType: "module"
909
+ }
910
+ },
911
+ plugins: {
912
+ antfu: default2,
913
+ import: default4,
914
+ ts: default11
915
+ },
916
+ rules: {
917
+ ...renameRules(
918
+ default11.configs["eslint-recommended"].overrides[0].rules,
919
+ "@typescript-eslint/",
920
+ "ts/"
921
+ ),
922
+ ...renameRules(
923
+ default11.configs.strict.rules,
924
+ "@typescript-eslint/",
925
+ "ts/"
926
+ ),
927
+ "antfu/generic-spacing": "error",
928
+ "antfu/named-tuple-spacing": "error",
929
+ "antfu/no-cjs-exports": "error",
930
+ "antfu/no-const-enum": "error",
931
+ "antfu/no-ts-export-equal": "error",
932
+ "no-dupe-class-members": OFF,
933
+ "no-extra-parens": OFF,
934
+ "no-invalid-this": OFF,
935
+ "no-loss-of-precision": OFF,
936
+ "no-redeclare": OFF,
937
+ "no-use-before-define": OFF,
938
+ "no-useless-constructor": OFF,
939
+ // TS
940
+ "ts/ban-ts-comment": ["error", { "ts-ignore": "allow-with-description" }],
941
+ "ts/ban-ts-ignore": OFF,
942
+ "ts/consistent-indexed-object-style": OFF,
943
+ "ts/consistent-type-definitions": ["error", "interface"],
944
+ "ts/consistent-type-imports": ["error", { disallowTypeAnnotations: false, prefer: "type-imports" }],
945
+ "ts/explicit-function-return-type": OFF,
946
+ "ts/explicit-member-accessibility": OFF,
947
+ "ts/explicit-module-boundary-types": OFF,
948
+ "ts/naming-convention": OFF,
949
+ "ts/no-dupe-class-members": "error",
950
+ "ts/no-empty-function": OFF,
951
+ "ts/no-empty-interface": OFF,
952
+ "ts/no-explicit-any": OFF,
953
+ "ts/no-extra-parens": ["error", "functions"],
954
+ "ts/no-invalid-this": "error",
955
+ "ts/no-loss-of-precision": "error",
956
+ "ts/no-invalid-void-type": OFF,
957
+ "ts/no-non-null-assertion": OFF,
958
+ "ts/no-redeclare": "error",
959
+ "ts/no-require-imports": "error",
960
+ "ts/no-unused-vars": OFF,
961
+ "ts/no-use-before-define": ["error", { classes: false, functions: false, variables: true }],
962
+ "ts/parameter-properties": OFF,
963
+ "ts/prefer-ts-expect-error": "error",
964
+ "ts/triple-slash-reference": OFF
965
+ }
966
+ },
967
+ {
968
+ files: ["**/*.d.ts"],
969
+ rules: {
970
+ "eslint-comments/no-unlimited-disable": OFF,
971
+ "import/no-duplicates": OFF,
972
+ "unused-imports/no-unused-vars": OFF
973
+ }
974
+ },
975
+ {
976
+ files: ["**/*.{test,spec}.ts?(x)"],
977
+ rules: {
978
+ "no-unused-expressions": OFF
979
+ }
980
+ },
981
+ {
982
+ files: ["**/*.js", "**/*.cjs"],
983
+ rules: {
984
+ "ts/no-require-imports": OFF,
985
+ "ts/no-var-requires": OFF
986
+ }
987
+ }
988
+ ];
989
+ }
990
+ function typescriptWithLanguageServer(options) {
991
+ const {
992
+ componentExts = [],
993
+ tsconfigPath,
994
+ tsconfigRootDir = process.cwd()
995
+ } = options;
996
+ return [
997
+ {
998
+ files: [
999
+ GLOB_TS,
1000
+ GLOB_TSX,
1001
+ ...componentExts.map((ext) => `**/*.${ext}`)
1002
+ ],
1003
+ ignores: ["**/*.md/*.*"],
1004
+ languageOptions: {
1005
+ parser: default17,
1006
+ parserOptions: {
1007
+ project: [tsconfigPath],
1008
+ tsconfigRootDir
1009
+ }
1010
+ },
1011
+ plugins: {
1012
+ ts: default11
1013
+ },
1014
+ rules: {
1015
+ "dot-notation": OFF,
1016
+ "no-implied-eval": OFF,
1017
+ "no-throw-literal": OFF,
1018
+ "require-await": OFF,
1019
+ "ts/await-thenable": "error",
1020
+ "ts/dot-notation": ["error", { allowKeywords: true }],
1021
+ "ts/no-floating-promises": "error",
1022
+ "ts/no-for-in-array": "error",
1023
+ "ts/no-implied-eval": "error",
1024
+ "ts/no-misused-promises": "error",
1025
+ "ts/no-throw-literal": "error",
1026
+ "ts/no-unnecessary-type-assertion": "error",
1027
+ "ts/no-unsafe-argument": "error",
1028
+ "ts/no-unsafe-assignment": "error",
1029
+ "ts/no-unsafe-call": "error",
1030
+ "ts/no-unsafe-member-access": "error",
1031
+ "ts/no-unsafe-return": "error",
1032
+ "ts/require-await": "error",
1033
+ "ts/restrict-plus-operands": "error",
1034
+ "ts/restrict-template-expressions": "error",
1035
+ "ts/unbound-method": "error"
1036
+ }
1037
+ }
1038
+ ];
1039
+ }
1040
+
1041
+ // src/configs/unicorn.ts
1042
+ var unicorn = [
1043
+ {
1044
+ plugins: {
1045
+ unicorn: default12
1046
+ },
1047
+ rules: {
1048
+ // Pass error message when throwing errors
1049
+ "unicorn/error-message": "error",
1050
+ // Uppercase regex escapes
1051
+ "unicorn/escape-case": "error",
1052
+ // Array.isArray instead of instanceof
1053
+ "unicorn/no-instanceof-array": "error",
1054
+ // Ban `new Array` as `Array` constructor's params are ambiguous
1055
+ "unicorn/no-new-array": "error",
1056
+ // Prevent deprecated `new Buffer()`
1057
+ "unicorn/no-new-buffer": "error",
1058
+ // Keep regex literals safe!
1059
+ "unicorn/no-unsafe-regex": "error",
1060
+ // Lowercase number formatting for octal, hex, binary (0x1'error' instead of 0X1'error')
1061
+ "unicorn/number-literal-case": "error",
1062
+ // includes over indexOf when checking for existence
1063
+ "unicorn/prefer-includes": "error",
1064
+ // Prefer using the node: protocol
1065
+ "unicorn/prefer-node-protocol": "error",
1066
+ // Prefer using number properties like `Number.isNaN` rather than `isNaN`
1067
+ "unicorn/prefer-number-properties": "error",
1068
+ // String methods startsWith/endsWith instead of more complicated stuff
1069
+ "unicorn/prefer-string-starts-ends-with": "error",
1070
+ // textContent instead of innerText
1071
+ "unicorn/prefer-text-content": "error",
1072
+ // Enforce throwing type error when throwing error while checking typeof
1073
+ "unicorn/prefer-type-error": "error",
1074
+ // Use new when throwing error
1075
+ "unicorn/throw-new-error": "error"
1076
+ }
1077
+ }
1078
+ ];
1079
+
1080
+ // src/configs/vue.ts
1081
+ var pkg = getPackageInfoSync("vue");
1082
+ var vueVersion = pkg && pkg.version;
1083
+ vueVersion = vueVersion && vueVersion[0];
1084
+ vueVersion = Number.isNaN(vueVersion) ? "3" : vueVersion;
1085
+ function vue(options = {}) {
1086
+ return [
1087
+ {
1088
+ files: [GLOB_VUE],
1089
+ languageOptions: {
1090
+ parser: default18,
1091
+ parserOptions: {
1092
+ ecmaFeatures: {
1093
+ jsx: true
1094
+ },
1095
+ extraFileExtensions: [".vue"],
1096
+ parser: options.typescript ? default17 : null,
1097
+ sourceType: "module"
1098
+ }
1099
+ },
1100
+ plugins: {
1101
+ vue: default14
1102
+ },
1103
+ processor: default14.processors[".vue"],
1104
+ rules: {
1105
+ ...default14.configs.base.rules,
1106
+ ...vueVersion === "3" ? {
1107
+ ...default14.configs["vue3-essential"].rules,
1108
+ ...default14.configs["vue3-strongly-recommended"].rules,
1109
+ ...default14.configs["vue3-recommended"].rules
1110
+ } : {
1111
+ ...default14.configs["essential"].rules,
1112
+ ...default14.configs["strongly-recommended"].rules,
1113
+ ...default14.configs["recommended"].rules
1114
+ },
1115
+ "vue/array-bracket-spacing": ["error", "never"],
1116
+ "vue/arrow-spacing": ["error", { after: true, before: true }],
1117
+ "vue/block-order": ["error", {
1118
+ order: ["template", "script", "style"]
1119
+ }],
1120
+ "vue/block-spacing": ["error", "always"],
1121
+ "vue/block-tag-newline": ["error", {
1122
+ multiline: "always",
1123
+ singleline: "always"
1124
+ }],
1125
+ "vue/brace-style": ["error", "stroustrup", { allowSingleLine: true }],
1126
+ "vue/comma-dangle": ["error", "always-multiline"],
1127
+ "vue/comma-spacing": ["error", { after: true, before: false }],
1128
+ "vue/comma-style": ["error", "last"],
1129
+ "vue/component-name-in-template-casing": ["error", "PascalCase"],
1130
+ "vue/component-options-name-casing": ["error", "PascalCase"],
1131
+ "vue/custom-event-name-casing": ["error", "camelCase"],
1132
+ "vue/define-macros-order": ["error", {
1133
+ order: ["defineOptions", "defineProps", "defineEmits", "defineSlots"]
1134
+ }],
1135
+ "vue/dot-location": ["error", "property"],
1136
+ "vue/dot-notation": ["error", { allowKeywords: true }],
1137
+ "vue/eqeqeq": ["error", "smart"],
1138
+ "vue/html-comment-content-spacing": ["error", "always", {
1139
+ exceptions: ["-"]
1140
+ }],
1141
+ "vue/key-spacing": ["error", { afterColon: true, beforeColon: false }],
1142
+ "vue/keyword-spacing": ["error", { after: true, before: true }],
1143
+ "vue/max-attributes-per-line": OFF,
1144
+ "vue/multi-word-component-names": OFF,
1145
+ "vue/no-constant-condition": "warn",
1146
+ "vue/no-dupe-keys": OFF,
1147
+ "vue/no-empty-pattern": "error",
1148
+ "vue/no-extra-parens": ["error", "functions"],
1149
+ "vue/no-irregular-whitespace": "error",
1150
+ "vue/no-loss-of-precision": "error",
1151
+ "vue/no-restricted-syntax": [
1152
+ "error",
1153
+ "DebuggerStatement",
1154
+ "LabeledStatement",
1155
+ "WithStatement"
1156
+ ],
1157
+ "vue/no-restricted-v-bind": ["error", "/^v-/"],
1158
+ // reactivity transform
1159
+ "vue/no-setup-props-reactivity-loss": OFF,
1160
+ "vue/no-sparse-arrays": "error",
1161
+ "vue/no-unused-refs": "error",
1162
+ "vue/no-useless-v-bind": "error",
1163
+ "vue/no-v-html": OFF,
1164
+ "vue/no-v-text-v-html-on-component": OFF,
1165
+ "vue/object-curly-newline": ["error", { consistent: true, multiline: true }],
1166
+ "vue/object-curly-spacing": ["error", "always"],
1167
+ "vue/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
1168
+ "vue/object-shorthand": [
1169
+ "error",
1170
+ "always",
1171
+ {
1172
+ avoidQuotes: true,
1173
+ ignoreConstructors: false
1174
+ }
1175
+ ],
1176
+ "vue/operator-linebreak": ["error", "before"],
1177
+ "vue/padding-line-between-blocks": ["error", "always"],
1178
+ "vue/prefer-separate-static-class": "error",
1179
+ "vue/prefer-template": "error",
1180
+ "vue/quote-props": ["error", "consistent-as-needed"],
1181
+ "vue/require-default-prop": OFF,
1182
+ "vue/require-prop-types": OFF,
1183
+ "vue/space-in-parens": ["error", "never"],
1184
+ "vue/space-infix-ops": "error",
1185
+ "vue/space-unary-ops": ["error", { nonwords: false, words: true }],
1186
+ "vue/template-curly-spacing": "error"
1187
+ }
1188
+ }
1189
+ ];
1190
+ }
1191
+
1192
+ // src/configs/yml.ts
1193
+ var yml = [
1194
+ {
1195
+ files: [GLOB_YAML],
1196
+ languageOptions: {
1197
+ parser: default19
1198
+ },
1199
+ plugins: {
1200
+ yml: default15
1201
+ },
1202
+ rules: {
1203
+ ...default15.configs.standard.rules,
1204
+ "style/spaced-comment": OFF,
1205
+ "yml/no-empty-document": OFF,
1206
+ "yml/no-empty-mapping-value": OFF,
1207
+ "yml/quotes": ["error", { avoidEscape: false, prefer: "single" }]
1208
+ }
1209
+ }
1210
+ ];
1211
+
1212
+ // src/configs/test.ts
1213
+ function test(options = {}) {
1214
+ return [
1215
+ {
1216
+ files: GLOB_TESTS,
1217
+ plugins: {
1218
+ "no-only-tests": default16
1219
+ },
1220
+ rules: {
1221
+ "no-only-tests/no-only-tests": options.isInEditor ? OFF : "error"
1222
+ }
1223
+ }
1224
+ ];
1225
+ }
1226
+
1227
+ // src/factory.ts
1228
+ function factoryFunc(options = {}, ...userConfigs) {
1229
+ const isInEditor = options.isInEditor ?? !!((process2.env.VSCODE_PID || process2.env.JETBRAINS_IDE) && !process2.env.CI);
1230
+ const enableVue = options.vue ?? (isPackageExists("vue") || isPackageExists("nuxt") || isPackageExists("vitepress") || isPackageExists("@slidev/cli"));
1231
+ const enableTypeScript = options.typescript ?? isPackageExists("typescript");
1232
+ const enableStylistic = options.stylistic ?? true;
1233
+ const configs = [
1234
+ ignores,
1235
+ javascript({ isInEditor }),
1236
+ comments,
1237
+ node,
1238
+ jsdoc,
1239
+ imports,
1240
+ unicorn
1241
+ ];
1242
+ const componentExts = [];
1243
+ if (enableVue)
1244
+ componentExts.push("vue");
1245
+ if (enableStylistic)
1246
+ configs.push(javascriptStylistic);
1247
+ if (enableTypeScript) {
1248
+ configs.push(typescript({ componentExts }));
1249
+ if (typeof enableTypeScript !== "boolean") {
1250
+ configs.push(typescriptWithLanguageServer({
1251
+ ...enableTypeScript,
1252
+ componentExts
1253
+ }));
1254
+ }
1255
+ if (enableStylistic)
1256
+ configs.push(typescriptStylistic);
1257
+ }
1258
+ if (options.test ?? true)
1259
+ configs.push(test({ isInEditor }));
1260
+ if (enableVue)
1261
+ configs.push(vue({ typescript: !!enableTypeScript }));
1262
+ if (options.jsonc ?? true) {
1263
+ configs.push(
1264
+ jsonc,
1265
+ sortPackageJson,
1266
+ sortTsconfig
1267
+ );
1268
+ }
1269
+ if (options.yaml ?? true)
1270
+ configs.push(yml);
1271
+ if (options.markdown ?? true)
1272
+ configs.push(markdown({ componentExts }));
1273
+ return combine(
1274
+ ...configs,
1275
+ ...userConfigs
1276
+ );
1277
+ }
1278
+
1279
+ // src/index.ts
1280
+ var src_default = factoryFunc;
1281
+ export {
1282
+ combine,
1283
+ comments,
1284
+ src_default as default,
1285
+ factoryFunc,
1286
+ ignores,
1287
+ imports,
1288
+ javascript,
1289
+ javascriptStylistic,
1290
+ jsdoc,
1291
+ jsonc,
1292
+ markdown,
1293
+ node,
1294
+ default20 as parserJsonc,
1295
+ default17 as parserTs,
1296
+ default18 as parserVue,
1297
+ default19 as parserYml,
1298
+ default2 as pluginAntfu,
1299
+ default3 as pluginComments,
1300
+ default4 as pluginImport,
1301
+ default5 as pluginJsdoc,
1302
+ default6 as pluginJsonc,
1303
+ default7 as pluginMarkdown,
1304
+ default16 as pluginNoOnlyTests,
1305
+ default8 as pluginNode,
1306
+ default9 as pluginStylisticJs,
1307
+ default10 as pluginStylisticTs,
1308
+ default11 as pluginTs,
1309
+ default12 as pluginUnicorn,
1310
+ default13 as pluginUnusedImports,
1311
+ default14 as pluginVue,
1312
+ default15 as pluginYml,
1313
+ renameRules,
1314
+ sortPackageJson,
1315
+ sortTsconfig,
1316
+ test,
1317
+ typescript,
1318
+ typescriptStylistic,
1319
+ typescriptWithLanguageServer,
1320
+ unicorn,
1321
+ vue,
1322
+ yml
1323
+ };