@coderwyd/eslint-config 1.0.10 → 1.1.0-beta.1

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