@favorodera/eslint-config 1.1.0 → 1.1.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.
Files changed (2) hide show
  1. package/dist/index.mjs +1 -1546
  2. package/package.json +1 -2
package/dist/index.mjs CHANGED
@@ -1,1546 +1 @@
1
- import { FlatConfigComposer } from "eslint-flat-config-utils";
2
- import { defu } from "defu";
3
- import globals from "globals";
4
- import { mergeProcessors, processorPassThrough } from "eslint-merge-processors";
5
- import vueBlocksProcessor from "eslint-processor-vue-blocks";
6
- //#region src/globs.ts
7
- /** Glob pattern for matching JavaScript files */
8
- const jsGlob = "**/*.{js,cjs,mjs}";
9
- /** Glob pattern for matching TypeScript files */
10
- const tsGlob = "**/*.{ts,cts,mts}";
11
- /** Glob pattern for matching Vue single-file components */
12
- const vueGlob = "**/*.vue";
13
- /** Glob pattern for matching Markdown files */
14
- const mdGlob = "**/*.md";
15
- /** Glob pattern for matching virtual files extracted from Markdown */
16
- const mdInMdGlob = "**/*.md/*.md";
17
- /** Glob pattern for matching code blocks embedded in Markdown files */
18
- const codeInMdGlob = "**/*.md/**/*.{js,cjs,mjs,ts,cts,mts,vue}";
19
- /** Glob pattern for matching scripts files */
20
- const scriptsGlob = "**/*.{js,cjs,mjs,ts,cts,mts}";
21
- /** Glob pattern for matching test files */
22
- const testGlob = "**/*.{test,spec,bench,benchmark}.{js,cjs,mjs,ts,cts,mts}";
23
- /** Glob pattern for matching JSON files */
24
- const jsonGlob = "**/*.json";
25
- /** Glob pattern for matching JSON5 files */
26
- const json5Glob = "**/*.json5";
27
- /** Glob pattern for matching JSON with Comments files */
28
- const jsoncGlob = "**/*.jsonc";
29
- /** Glob patterns for matching TypeScript configuration files */
30
- const tsConfigGlob = ["**/tsconfig.json", "**/tsconfig.*.json"];
31
- /** Glob pattern for matching YAML files */
32
- const yamlGlob = "**/*.{yml,yaml}";
33
- /** Glob pattern for matching pnpm-workspace.yaml file */
34
- const pnpmWorkspaceGlob = "pnpm-workspace.yaml";
35
- /** Glob pattern for matching package.json files */
36
- const packageJsonGlob = "**/package.json";
37
- /**
38
- * Common glob patterns for files and directories that should be ignored by ESLint.
39
- * Includes node_modules, build outputs, lock files, temporary files, and tool-specific caches.
40
- */
41
- const ignoresGlob = [
42
- "**/node_modules/**",
43
- "**/dist/**",
44
- "**/package-lock.json",
45
- "**/yarn.lock",
46
- "**/pnpm-lock.yaml",
47
- "**/bun.lockb",
48
- "**/output",
49
- "**/coverage",
50
- "**/temp",
51
- "**/.temp",
52
- "**/tmp",
53
- "**/.tmp",
54
- "**/.history",
55
- "**/.vitepress/cache",
56
- "**/.nuxt",
57
- "**/.next",
58
- "**/.svelte-kit",
59
- "**/.vercel",
60
- "**/.changeset",
61
- "**/.idea",
62
- "**/.cache",
63
- "**/.output",
64
- "**/.vite-inspect",
65
- "**/.yarn",
66
- "**/CHANGELOG*.md",
67
- "**/LICENSE*",
68
- "**/*.min.*",
69
- "**/__snapshots__",
70
- "**/vite.config.*.timestamp-*",
71
- "**/auto-import?(s).d.ts",
72
- "**/components.d.ts",
73
- "**/.context",
74
- "**/.claude",
75
- "**/.agents",
76
- "**/.*/skills"
77
- ];
78
- //#endregion
79
- //#region src/configs/disables.ts
80
- /**
81
- * Centralized disable configs applied **last** in the composer chain
82
- * so they always override any rule enabled by preceding configs.
83
- * @returns Config items that turn off specific rules for targeted file globs.
84
- */
85
- function disables() {
86
- return [
87
- {
88
- files: [
89
- json5Glob,
90
- jsoncGlob,
91
- jsonGlob
92
- ],
93
- name: "favorodera/disables/jsonc",
94
- rules: { "no-irregular-whitespace": "off" }
95
- },
96
- {
97
- files: [mdGlob],
98
- ignores: [mdInMdGlob],
99
- name: "favorodera/disables/markdown",
100
- rules: { "md/no-missing-atx-heading-space": "off" }
101
- },
102
- {
103
- files: [codeInMdGlob],
104
- languageOptions: { parserOptions: { ecmaFeatures: { impliedStrict: true } } },
105
- name: "favorodera/disables/code-in-markdown",
106
- rules: {
107
- "no-alert": "off",
108
- "no-console": "off",
109
- "no-labels": "off",
110
- "no-lone-blocks": "off",
111
- "no-restricted-syntax": "off",
112
- "no-undef": "off",
113
- "no-unused-expressions": "off",
114
- "no-unused-labels": "off",
115
- "no-unused-vars": "off",
116
- "unicode-bom": "off",
117
- "node/no-extraneous-import": "off",
118
- "node/prefer-global/process": "off",
119
- "style/comma-dangle": "off",
120
- "style/eol-last": "off",
121
- "style/line-comment-position": "off",
122
- "style/padding-line-between-statements": "off",
123
- "ts/consistent-type-imports": "off",
124
- "ts/explicit-function-return-type": "off",
125
- "ts/no-namespace": "off",
126
- "ts/no-redeclare": "off",
127
- "ts/no-require-imports": "off",
128
- "ts/no-unused-expressions": "off",
129
- "ts/no-unused-vars": "off",
130
- "ts/no-use-before-define": "off",
131
- "unused-imports/no-unused-imports": "off",
132
- "unused-imports/no-unused-vars": "off",
133
- "vue/no-unused-vars": "off",
134
- "jsdoc/require-jsdoc": "off"
135
- }
136
- },
137
- {
138
- files: [
139
- jsGlob,
140
- tsGlob,
141
- vueGlob
142
- ],
143
- name: "favorodera/disables/js-ts-vue",
144
- rules: {
145
- "jsdoc/require-throws-type": "off",
146
- "node/no-missing-import": "off",
147
- "node/no-missing-require": "off",
148
- "tailwind/enforce-consistent-important-position": "off",
149
- "tailwind/enforce-consistent-variable-syntax": "off",
150
- "tailwind/enforce-shorthand-classes": "off",
151
- "unicorn/filename-case": "off",
152
- "unicorn/name-replacements": "off",
153
- "unicorn/no-process-exit": "off",
154
- "no-unused-vars": "off",
155
- "ts/no-unused-vars": "off"
156
- }
157
- },
158
- {
159
- files: [vueGlob],
160
- name: "favorodera/disables/vue",
161
- rules: { "vue/multi-word-component-names": "off" }
162
- },
163
- {
164
- files: [testGlob],
165
- name: "favorodera/disables/test",
166
- rules: { "no-unused-expressions": "off" }
167
- }
168
- ];
169
- }
170
- //#endregion
171
- //#region src/configs/ignores.ts
172
- const defaultPatterns = ignoresGlob;
173
- /**
174
- * Globs for ignoring files and directories from ESLint scanning.
175
- * @param patterns Additional ignore patterns or a function to modify the defaults.
176
- * @returns An array containing the ignore flat config item.
177
- */
178
- function ignores(patterns = []) {
179
- return [{
180
- ignores: typeof patterns === "function" ? patterns(defaultPatterns) : [...defaultPatterns, ...patterns],
181
- name: "favorodera/ignores"
182
- }];
183
- }
184
- //#endregion
185
- //#region src/utils.ts
186
- /**
187
- * Extracts and merges the rules from multiple ESLint configuration arrays.
188
- * @param configArrays Rest parameter representing multiple arrays of ESLint flat config items.
189
- * @returns A single object containing all the merged rules from the provided configurations.
190
- */
191
- function extractRules(...configArrays) {
192
- return Object.assign({}, ...configArrays.flat().map((config) => config?.rules || {}));
193
- }
194
- /**
195
- * Resolves a module (or a promise of one) and returns its default export
196
- * if present, otherwise returns the module itself.
197
- *
198
- * Handles both ESM modules (which wrap exports under `.default`) and
199
- * CJS / plain-object modules uniformly.
200
- * @template TModule The type of the module being imported.
201
- * @param module A module or a promise that resolves to one.
202
- * @returns The `.default` export if it exists, otherwise the module itself.
203
- */
204
- async function importModule(module) {
205
- const resolved = await module;
206
- if (resolved !== null && typeof resolved === "object" && "default" in resolved) return resolved.default;
207
- return resolved;
208
- }
209
- /**
210
- * Normalize boolean or options value into merged options or null.
211
- * Returns null when the input is false or undefined.
212
- * @template TOptions The type of the options object.
213
- * @param value The configuration value, which can be a boolean, an options object, or undefined.
214
- * @param defaults The default options to merge with if `value` is true or an object.
215
- * @returns The merged options object, or false if the feature is disabled.
216
- */
217
- function resolveOptions(value, defaults) {
218
- if (!value) return false;
219
- return defu(value === true ? {} : value, defaults);
220
- }
221
- /**
222
- * Creates a new object that omits the specified keys from the target object.
223
- * @template TTarget The type of the target object.
224
- * @template TTargetKeys The type of the keys to omit from the target object.
225
- * @param target The target object from which to omit the specified keys.
226
- * @param keys An array of keys to omit from the target object.
227
- * @returns A new object that contains all properties of the target object except for the specified keys.
228
- */
229
- function omit(target, keys) {
230
- const targetClone = { ...target };
231
- for (const key of keys) Reflect.deleteProperty(targetClone, key);
232
- return targetClone;
233
- }
234
- //#endregion
235
- //#region src/configs/imports.ts
236
- /**
237
- * Constructs the flat config items for imports linting, providing plugin setup and
238
- * specific rules to enforce consistent import ordering and quality.
239
- * @returns Promise resolving to imports ESLint config items.
240
- */
241
- async function imports() {
242
- const importPlugin = await importModule(import("eslint-plugin-import-lite"));
243
- const files = [
244
- jsGlob,
245
- tsGlob,
246
- vueGlob
247
- ];
248
- const recommendedConfig = importPlugin.configs.recommended;
249
- const { rules = {} } = recommendedConfig;
250
- return [{
251
- ...omit(recommendedConfig, [
252
- "rules",
253
- "files",
254
- "name"
255
- ]),
256
- name: "favorodera/imports/setup"
257
- }, {
258
- files,
259
- name: "favorodera/imports/rules",
260
- rules: {
261
- ...rules,
262
- "import/consistent-type-specifier-style": ["error", "prefer-top-level"],
263
- "import/first": "error",
264
- "import/newline-after-import": ["error", { count: 1 }],
265
- "import/no-duplicates": ["error", { "prefer-inline": true }],
266
- "import/no-mutable-exports": "error",
267
- "import/no-named-default": "error"
268
- }
269
- }];
270
- }
271
- //#endregion
272
- //#region src/configs/javascript.ts
273
- /**
274
- * Constructs the flat config items for core JavaScript linting, setting up the required
275
- * language options, globals, and recommended baseline rules.
276
- * @returns Promise resolving to javascript ESLint config items.
277
- */
278
- async function javascript() {
279
- const jsPlugin = await importModule(import("@eslint/js"));
280
- const files = [
281
- jsGlob,
282
- tsGlob,
283
- vueGlob
284
- ];
285
- return [{
286
- languageOptions: {
287
- ecmaVersion: "latest",
288
- globals: {
289
- ...globals.browser,
290
- ...globals.es2021,
291
- ...globals.node,
292
- document: "readonly",
293
- navigator: "readonly",
294
- window: "readonly"
295
- },
296
- sourceType: "module"
297
- },
298
- linterOptions: { reportUnusedDisableDirectives: true },
299
- name: "favorodera/javascript/setup"
300
- }, {
301
- files,
302
- name: "favorodera/javascript/rules",
303
- rules: {
304
- ...jsPlugin.configs.recommended.rules,
305
- "array-callback-return": ["error", { allowImplicit: true }],
306
- "block-scoped-var": "error",
307
- "default-case-last": "error",
308
- "dot-notation": "error",
309
- "eqeqeq": "error",
310
- "getter-return": ["error", { allowImplicit: true }],
311
- "new-cap": "error",
312
- "no-alert": "error",
313
- "no-array-constructor": "error",
314
- "no-caller": "error",
315
- "no-console": ["error", { allow: ["warn", "error"] }],
316
- "no-constructor-return": "error",
317
- "no-continue": "error",
318
- "no-else-return": "error",
319
- "no-empty": ["error", { allowEmptyCatch: true }],
320
- "no-eq-null": "error",
321
- "no-eval": "error",
322
- "no-extend-native": "error",
323
- "no-extra-bind": "error",
324
- "no-implied-eval": "error",
325
- "no-iterator": "error",
326
- "no-labels": ["error", {
327
- allowLoop: false,
328
- allowSwitch: false
329
- }],
330
- "no-lone-blocks": "error",
331
- "no-loop-func": "error",
332
- "no-multi-str": "error",
333
- "no-negated-condition": "error",
334
- "no-nested-ternary": "error",
335
- "no-new": "error",
336
- "no-new-func": "error",
337
- "no-new-wrappers": "error",
338
- "no-object-constructor": "error",
339
- "no-octal-escape": "error",
340
- "no-param-reassign": "error",
341
- "no-promise-executor-return": "error",
342
- "no-proto": "error",
343
- "no-return-assign": "error",
344
- "no-script-url": "error",
345
- "no-self-compare": "error",
346
- "no-sequences": "error",
347
- "no-template-curly-in-string": "error",
348
- "no-throw-literal": "error",
349
- "no-undef-init": "error",
350
- "no-unmodified-loop-condition": "error",
351
- "no-unneeded-ternary": ["error", { defaultAssignment: false }],
352
- "no-unreachable-loop": "error",
353
- "no-unused-expressions": ["error", {
354
- allowShortCircuit: true,
355
- allowTaggedTemplates: true,
356
- allowTernary: true
357
- }],
358
- "no-use-before-define": ["error", {
359
- classes: false,
360
- functions: false
361
- }],
362
- "no-useless-call": "error",
363
- "no-useless-computed-key": "error",
364
- "no-useless-concat": "error",
365
- "no-useless-constructor": "error",
366
- "no-useless-rename": "error",
367
- "no-useless-return": "error",
368
- "object-shorthand": [
369
- "error",
370
- "always",
371
- {
372
- avoidQuotes: true,
373
- ignoreConstructors: false
374
- }
375
- ],
376
- "one-var": ["error", { initialized: "never" }],
377
- "prefer-arrow-callback": ["error", {
378
- allowNamedFunctions: false,
379
- allowUnboundThis: true
380
- }],
381
- "prefer-const": ["error", {
382
- destructuring: "all",
383
- ignoreReadBeforeAssign: true
384
- }],
385
- "prefer-exponentiation-operator": "error",
386
- "prefer-promise-reject-errors": "error",
387
- "prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
388
- "prefer-template": "error",
389
- "symbol-description": "error",
390
- "unicode-bom": "error",
391
- "valid-typeof": ["error", { requireStringLiterals: true }],
392
- "vars-on-top": "error",
393
- "yoda": "error"
394
- }
395
- }];
396
- }
397
- //#endregion
398
- //#region src/configs/jsdoc.ts
399
- /**
400
- * Constructs the flat config items for JSDoc linting, ensuring comments follow
401
- * proper styling, parameter checks, and types alignment.
402
- * @returns Promise resolving to JSDoc ESLint config items.
403
- */
404
- async function jsdoc() {
405
- const jsdocPlugin = await importModule(import("eslint-plugin-jsdoc"));
406
- const files = [
407
- jsGlob,
408
- tsGlob,
409
- vueGlob
410
- ];
411
- const recommendedConfig = jsdocPlugin.configs["flat/recommended-typescript-error"];
412
- const stylisticConfig = jsdocPlugin.configs["flat/stylistic-typescript-error"];
413
- const { rules: recommendedRules = {} } = recommendedConfig;
414
- const recommendedRest = omit(recommendedConfig, [
415
- "rules",
416
- "files",
417
- "name"
418
- ]);
419
- const { rules: stylisticRules = {} } = stylisticConfig;
420
- const stylisticRest = omit(stylisticConfig, [
421
- "rules",
422
- "files",
423
- "name"
424
- ]);
425
- const rules = {
426
- ...recommendedRules,
427
- ...stylisticRules
428
- };
429
- return [
430
- {
431
- ...recommendedRest,
432
- name: "favorodera/jsdoc/recommended/setup"
433
- },
434
- {
435
- ...stylisticRest,
436
- name: "favorodera/jsdoc/stylistic/setup"
437
- },
438
- {
439
- files,
440
- name: "favorodera/jsdoc/rules",
441
- rules: {
442
- ...rules,
443
- "jsdoc/check-indentation": "error",
444
- "jsdoc/check-template-names": "error",
445
- "jsdoc/imports-as-dependencies": "error",
446
- "jsdoc/lines-before-block": ["error", { ignoreSingleLines: false }],
447
- "jsdoc/multiline-blocks": "error",
448
- "jsdoc/no-bad-blocks": "error",
449
- "jsdoc/no-blank-block-descriptions": "error",
450
- "jsdoc/no-blank-blocks": "error",
451
- "jsdoc/sort-tags": "error"
452
- }
453
- }
454
- ];
455
- }
456
- //#endregion
457
- //#region src/configs/jsonc.ts
458
- /**
459
- * Constructs the flat config items for JSON, JSON5, and JSONC linting, setting up
460
- * the custom parser, rule validations, and sorting rules for package.json/tsconfig.json.
461
- * @returns Promise resolving to JSONC ESLint config items.
462
- */
463
- async function jsonc() {
464
- return [
465
- {
466
- name: "favorodera/jsonc/setup",
467
- plugins: { jsonc: await importModule(import("eslint-plugin-jsonc")) }
468
- },
469
- {
470
- files: [
471
- json5Glob,
472
- jsoncGlob,
473
- jsonGlob
474
- ],
475
- language: "jsonc/x",
476
- name: "favorodera/jsonc/rules",
477
- rules: {
478
- "jsonc/array-bracket-newline": "error",
479
- "jsonc/array-bracket-spacing": ["error", "never"],
480
- "jsonc/array-element-newline": "error",
481
- "jsonc/comma-dangle": ["error", "never"],
482
- "jsonc/comma-style": ["error", "last"],
483
- "jsonc/indent": ["error", 2],
484
- "jsonc/key-spacing": ["error", {
485
- afterColon: true,
486
- beforeColon: false
487
- }],
488
- "jsonc/no-bigint-literals": "error",
489
- "jsonc/no-binary-expression": "error",
490
- "jsonc/no-binary-numeric-literals": "error",
491
- "jsonc/no-dupe-keys": "error",
492
- "jsonc/no-escape-sequence-in-identifier": "error",
493
- "jsonc/no-floating-decimal": "error",
494
- "jsonc/no-hexadecimal-numeric-literals": "error",
495
- "jsonc/no-infinity": "error",
496
- "jsonc/no-irregular-whitespace": "error",
497
- "jsonc/no-multi-str": "error",
498
- "jsonc/no-nan": "error",
499
- "jsonc/no-number-props": "error",
500
- "jsonc/no-numeric-separators": "error",
501
- "jsonc/no-octal": "error",
502
- "jsonc/no-octal-escape": "error",
503
- "jsonc/no-octal-numeric-literals": "error",
504
- "jsonc/no-parenthesized": "error",
505
- "jsonc/no-plus-sign": "error",
506
- "jsonc/no-regexp-literals": "error",
507
- "jsonc/no-sparse-arrays": "error",
508
- "jsonc/no-template-literals": "error",
509
- "jsonc/no-undefined-value": "error",
510
- "jsonc/no-unicode-codepoint-escapes": "error",
511
- "jsonc/no-useless-escape": "error",
512
- "jsonc/object-curly-newline": ["error", {
513
- consistent: true,
514
- multiline: true
515
- }],
516
- "jsonc/object-curly-spacing": ["error", "always"],
517
- "jsonc/object-property-newline": ["error", { allowAllPropertiesOnSameLine: false }],
518
- "jsonc/quote-props": "error",
519
- "jsonc/quotes": "error",
520
- "jsonc/space-unary-ops": "error",
521
- "jsonc/valid-json-number": "error",
522
- "jsonc/vue-custom-block/no-parsing-error": "error"
523
- }
524
- },
525
- {
526
- files: [packageJsonGlob],
527
- name: "favorodera/jsonc/sort/package-json",
528
- rules: {
529
- "jsonc/sort-array-values": ["error", {
530
- order: { type: "asc" },
531
- pathPattern: "^files$"
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
- "contributors",
547
- "license",
548
- "funding",
549
- "homepage",
550
- "repository",
551
- "bugs",
552
- "keywords",
553
- "categories",
554
- "sideEffects",
555
- "imports",
556
- "exports",
557
- "main",
558
- "module",
559
- "unpkg",
560
- "jsdelivr",
561
- "types",
562
- "typesVersions",
563
- "bin",
564
- "icon",
565
- "files",
566
- "engines",
567
- "activationEvents",
568
- "contributes",
569
- "scripts",
570
- "peerDependencies",
571
- "peerDependenciesMeta",
572
- "dependencies",
573
- "optionalDependencies",
574
- "devDependencies",
575
- "pnpm",
576
- "overrides",
577
- "resolutions",
578
- "husky",
579
- "simple-git-hooks",
580
- "lint-staged",
581
- "eslintConfig"
582
- ],
583
- pathPattern: "^$"
584
- },
585
- {
586
- order: { type: "asc" },
587
- pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"
588
- },
589
- {
590
- order: { type: "asc" },
591
- pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$"
592
- },
593
- {
594
- order: { type: "asc" },
595
- pathPattern: String.raw`^workspaces\.catalog$`
596
- },
597
- {
598
- order: { type: "asc" },
599
- pathPattern: String.raw`^workspaces\.catalogs\.[^.]+$`
600
- },
601
- {
602
- order: [
603
- "types",
604
- "import",
605
- "require",
606
- "default"
607
- ],
608
- pathPattern: "^exports.*$"
609
- },
610
- {
611
- order: [
612
- "pre-commit",
613
- "prepare-commit-msg",
614
- "commit-msg",
615
- "post-commit",
616
- "pre-rebase",
617
- "post-rewrite",
618
- "post-checkout",
619
- "post-merge",
620
- "pre-push",
621
- "pre-auto-gc"
622
- ],
623
- pathPattern: "^(?:gitHooks|husky|simple-git-hooks)$"
624
- }
625
- ]
626
- }
627
- },
628
- {
629
- files: tsConfigGlob,
630
- name: "favorodera/jsonc/sort/tsconfig-json",
631
- rules: { "jsonc/sort-keys": [
632
- "error",
633
- {
634
- order: [
635
- "extends",
636
- "compilerOptions",
637
- "references",
638
- "files",
639
- "include",
640
- "exclude"
641
- ],
642
- pathPattern: "^$"
643
- },
644
- {
645
- order: [
646
- "incremental",
647
- "composite",
648
- "tsBuildInfoFile",
649
- "disableSourceOfProjectReferenceRedirect",
650
- "disableSolutionSearching",
651
- "disableReferencedProjectLoad",
652
- "target",
653
- "jsx",
654
- "jsxFactory",
655
- "jsxFragmentFactory",
656
- "jsxImportSource",
657
- "lib",
658
- "moduleDetection",
659
- "noLib",
660
- "reactNamespace",
661
- "useDefineForClassFields",
662
- "emitDecoratorMetadata",
663
- "experimentalDecorators",
664
- "libReplacement",
665
- "baseUrl",
666
- "rootDir",
667
- "rootDirs",
668
- "customConditions",
669
- "module",
670
- "moduleResolution",
671
- "moduleSuffixes",
672
- "noResolve",
673
- "paths",
674
- "resolveJsonModule",
675
- "resolvePackageJsonExports",
676
- "resolvePackageJsonImports",
677
- "typeRoots",
678
- "types",
679
- "allowArbitraryExtensions",
680
- "allowImportingTsExtensions",
681
- "allowUmdGlobalAccess",
682
- "allowJs",
683
- "checkJs",
684
- "maxNodeModuleJsDepth",
685
- "strict",
686
- "strictBindCallApply",
687
- "strictFunctionTypes",
688
- "strictNullChecks",
689
- "strictPropertyInitialization",
690
- "allowUnreachableCode",
691
- "allowUnusedLabels",
692
- "alwaysStrict",
693
- "exactOptionalPropertyTypes",
694
- "noFallthroughCasesInSwitch",
695
- "noImplicitAny",
696
- "noImplicitOverride",
697
- "noImplicitReturns",
698
- "noImplicitThis",
699
- "noPropertyAccessFromIndexSignature",
700
- "noUncheckedIndexedAccess",
701
- "noUnusedLocals",
702
- "noUnusedParameters",
703
- "useUnknownInCatchVariables",
704
- "declaration",
705
- "declarationDir",
706
- "declarationMap",
707
- "downlevelIteration",
708
- "emitBOM",
709
- "emitDeclarationOnly",
710
- "importHelpers",
711
- "importsNotUsedAsValues",
712
- "inlineSourceMap",
713
- "inlineSources",
714
- "mapRoot",
715
- "newLine",
716
- "noEmit",
717
- "noEmitHelpers",
718
- "noEmitOnError",
719
- "outDir",
720
- "outFile",
721
- "preserveConstEnums",
722
- "preserveValueImports",
723
- "removeComments",
724
- "sourceMap",
725
- "sourceRoot",
726
- "stripInternal",
727
- "allowSyntheticDefaultImports",
728
- "esModuleInterop",
729
- "forceConsistentCasingInFileNames",
730
- "isolatedDeclarations",
731
- "isolatedModules",
732
- "preserveSymlinks",
733
- "verbatimModuleSyntax",
734
- "erasableSyntaxOnly",
735
- "skipDefaultLibCheck",
736
- "skipLibCheck"
737
- ],
738
- pathPattern: "^compilerOptions$"
739
- }
740
- ] }
741
- }
742
- ];
743
- }
744
- //#endregion
745
- //#region src/configs/markdown.ts
746
- const markdownDefaults = { gfm: true };
747
- /**
748
- * Constructs the flat config items for Markdown linting, extracting and linting
749
- * embedded code blocks within the document according to specified rules.
750
- * @param options Markdown configuration options.
751
- * @returns Promise resolving to Markdown ESLint config items.
752
- */
753
- async function markdown(options) {
754
- const resolved = defu(options, markdownDefaults);
755
- const markdownPlugin = await importModule(import("@eslint/markdown"));
756
- const [recommendedConfig] = markdownPlugin.configs.recommended;
757
- const { rules = {} } = recommendedConfig;
758
- return [{
759
- ...omit(recommendedConfig, [
760
- "rules",
761
- "files",
762
- "name",
763
- "language"
764
- ]),
765
- name: "favorodera/markdown/setup"
766
- }, {
767
- files: [mdGlob],
768
- ignores: [mdInMdGlob],
769
- language: resolved.gfm ? "md/gfm" : "md/commonmark",
770
- languageOptions: { frontmatter: "yaml" },
771
- name: "favorodera/markdown/rules",
772
- processor: mergeProcessors([markdownPlugin.processors?.markdown, processorPassThrough]),
773
- rules
774
- }];
775
- }
776
- //#endregion
777
- //#region src/configs/node.ts
778
- /**
779
- * Constructs the flat config items for Node.js linting, providing rules
780
- * to enforce best practices for Node.js environments.
781
- * @returns Promise resolving to Node ESLint config items.
782
- */
783
- async function node() {
784
- const nodePlugin = await importModule(import("eslint-plugin-n"));
785
- const files = [
786
- jsGlob,
787
- tsGlob,
788
- vueGlob
789
- ];
790
- const recommendedConfig = nodePlugin.configs["flat/recommended-module"];
791
- const { rules = {} } = recommendedConfig;
792
- return [{
793
- ...omit(recommendedConfig, [
794
- "rules",
795
- "files",
796
- "name"
797
- ]),
798
- name: "favorodera/node/setup"
799
- }, {
800
- files,
801
- name: "favorodera/node/rules",
802
- rules: {
803
- ...rules,
804
- "node/callback-return": "error",
805
- "node/handle-callback-err": ["error", "^(err|error)$"],
806
- "node/no-callback-literal": "error",
807
- "node/no-new-require": "error",
808
- "node/no-path-concat": "error",
809
- "node/no-unpublished-import": "error",
810
- "node/prefer-global/buffer": "error",
811
- "node/prefer-global/console": "error",
812
- "node/prefer-global/crypto": "error",
813
- "node/prefer-global/process": "error",
814
- "node/prefer-global/text-decoder": "error",
815
- "node/prefer-global/text-encoder": "error",
816
- "node/prefer-global/timers": "error",
817
- "node/prefer-global/url": "error",
818
- "node/prefer-global/url-search-params": "error",
819
- "node/prefer-node-protocol": "error",
820
- "node/prefer-promises/dns": "error",
821
- "node/prefer-promises/fs": "error"
822
- }
823
- }];
824
- }
825
- //#endregion
826
- //#region src/configs/perfectionist.ts
827
- const perfectionistDefaults = {
828
- ignoreCase: true,
829
- locales: "en-US",
830
- newlinesBetween: "ignore",
831
- newlinesInside: "ignore",
832
- order: "asc",
833
- partitionByComment: true,
834
- partitionByNewLine: true,
835
- specialCharacters: "keep",
836
- type: "natural"
837
- };
838
- /**
839
- * Constructs the flat config items for Perfectionist linting, providing rules
840
- * to naturally sort objects, imports, classes, and other elements in your code.
841
- * @param options Perfectionist configuration options.
842
- * @returns Promise resolving to Perfectionist ESLint config items.
843
- */
844
- async function perfectionist(options) {
845
- const resolved = defu(options, perfectionistDefaults);
846
- const perfectionistPlugin = await importModule(import("eslint-plugin-perfectionist"));
847
- const files = [
848
- jsGlob,
849
- tsGlob,
850
- vueGlob
851
- ];
852
- const safeType = resolved.type ?? "natural";
853
- const presetConfig = perfectionistPlugin.configs[`recommended-${safeType}`];
854
- const { rules = {} } = presetConfig;
855
- return [{
856
- ...omit(presetConfig, [
857
- "rules",
858
- "settings",
859
- "files",
860
- "name"
861
- ]),
862
- name: "favorodera/perfectionist/setup",
863
- settings: { perfectionist: resolved }
864
- }, {
865
- files,
866
- name: "favorodera/perfectionist/rules",
867
- rules
868
- }];
869
- }
870
- //#endregion
871
- //#region src/configs/pnpm.ts
872
- /**
873
- * Constructs the flat config items for pnpm linting.
874
- * @returns Promise resolving to pnpm ESLint config items.
875
- */
876
- async function pnpm() {
877
- const [pnpmPlugin, yamlParser] = await Promise.all([importModule(import("eslint-plugin-pnpm")), importModule(import("yaml-eslint-parser"))]);
878
- return [
879
- {
880
- name: "favorodera/pnpm/setup",
881
- plugins: { pnpm: pnpmPlugin }
882
- },
883
- {
884
- files: [packageJsonGlob],
885
- language: "jsonc/x",
886
- name: "favorodera/pnpm/package-json",
887
- rules: {
888
- "pnpm/json-enforce-catalog": ["error", {
889
- autofix: false,
890
- fields: [
891
- "dependencies",
892
- "devDependencies",
893
- "optionalDependencies",
894
- "peerDependencies"
895
- ],
896
- ignores: ["@types/vscode"]
897
- }],
898
- "pnpm/json-prefer-workspace-settings": ["error", { autofix: true }],
899
- "pnpm/json-valid-catalog": ["error", { autofix: false }]
900
- }
901
- },
902
- {
903
- files: [pnpmWorkspaceGlob],
904
- languageOptions: { parser: yamlParser },
905
- name: "favorodera/pnpm/pnpm-workspace-yaml",
906
- rules: {
907
- "pnpm/yaml-enforce-settings": ["error", { settings: {
908
- allowBuilds: {
909
- "@parcel/watcher": true,
910
- "@tailwindcss/oxide": true,
911
- "better-sqlite3": true,
912
- "esbuild": true,
913
- "sharp": true,
914
- "unrs-resolver": true,
915
- "vue-demi": true
916
- },
917
- shellEmulator: true,
918
- trustPolicy: "no-downgrade"
919
- } }],
920
- "pnpm/yaml-no-duplicate-catalog-item": ["error", { checkDuplicates: "exact-version" }],
921
- "pnpm/yaml-no-unused-catalog-item": "error",
922
- "pnpm/yaml-valid-packages": "error"
923
- }
924
- }
925
- ];
926
- }
927
- //#endregion
928
- //#region src/configs/stylistic.ts
929
- const stylisticDefaults = {
930
- braceStyle: "1tbs",
931
- experimental: false,
932
- indent: 2,
933
- jsx: false,
934
- quotes: "single",
935
- semi: false
936
- };
937
- /**
938
- * Constructs the flat config items for Stylistic linting, applying customized
939
- * formatting settings such as quotes, indentation, and spacing.
940
- * @param options Stylistic configuration options.
941
- * @returns Promise resolving to stylistic ESLint config items.
942
- */
943
- async function stylistic(options) {
944
- const resolved = defu(options, stylisticDefaults);
945
- const stylePlugin = await importModule(import("@stylistic/eslint-plugin"));
946
- const files = [
947
- jsGlob,
948
- tsGlob,
949
- vueGlob
950
- ];
951
- const recommendedConfig = stylePlugin.configs.customize({
952
- pluginName: "style",
953
- ...resolved
954
- });
955
- const { rules = {} } = recommendedConfig;
956
- return [{
957
- ...omit(recommendedConfig, [
958
- "rules",
959
- "files",
960
- "name"
961
- ]),
962
- name: "favorodera/stylistic/setup"
963
- }, {
964
- files,
965
- name: "favorodera/stylistic/rules",
966
- rules: {
967
- ...rules,
968
- "style/array-bracket-newline": "error",
969
- "style/array-element-newline": "error",
970
- "style/curly-newline": ["error", "always"],
971
- "style/function-call-argument-newline": ["error", "consistent"],
972
- "style/function-call-spacing": "error",
973
- "style/function-paren-newline": "error",
974
- "style/implicit-arrow-linebreak": "error",
975
- "style/line-comment-position": "error",
976
- "style/linebreak-style": "error",
977
- "style/multiline-comment-style": ["error", "separate-lines"],
978
- "style/newline-per-chained-call": "error",
979
- "style/no-confusing-arrow": "error",
980
- "style/no-extra-semi": "error",
981
- "style/nonblock-statement-body-position": "error",
982
- "style/object-curly-newline": "error",
983
- "style/semi-style": "error",
984
- "style/switch-colon-spacing": "error",
985
- "style/wrap-regex": "error"
986
- }
987
- }];
988
- }
989
- //#endregion
990
- //#region src/configs/tailwind.ts
991
- const tailwindDefaults = { detectComponentClasses: true };
992
- /**
993
- * Constructs the flat config items for Tailwind CSS linting, providing custom settings
994
- * to parse and lint utility classes, and enforcing consistent ordering.
995
- * @param options Tailwind configuration options.
996
- * @returns Promise resolving to Tailwind ESLint config items.
997
- */
998
- async function tailwind(options) {
999
- const resolved = defu(options, tailwindDefaults);
1000
- const tailwindPlugin = await importModule(import("eslint-plugin-better-tailwindcss"));
1001
- const files = [
1002
- jsGlob,
1003
- tsGlob,
1004
- vueGlob
1005
- ];
1006
- const recommendedConfig = tailwindPlugin.configs["recommended-error"];
1007
- const stylisticConfig = tailwindPlugin.configs["stylistic-error"];
1008
- const { rules: recommendedRules } = recommendedConfig;
1009
- const recommendedRest = omit(recommendedConfig, ["rules"]);
1010
- const { rules: stylisticRules } = stylisticConfig;
1011
- const stylisticRest = omit(stylisticConfig, ["rules"]);
1012
- const rules = {
1013
- ...recommendedRules,
1014
- ...stylisticRules
1015
- };
1016
- return [
1017
- {
1018
- ...recommendedRest,
1019
- name: "favorodera/tailwind/recommended/setup"
1020
- },
1021
- {
1022
- ...stylisticRest,
1023
- name: "favorodera/tailwind/stylistic/setup"
1024
- },
1025
- {
1026
- files,
1027
- name: "favorodera/tailwind/rules",
1028
- rules: {
1029
- ...rules,
1030
- "tailwind/enforce-consistent-class-order": ["error", {
1031
- componentClassOrder: "asc",
1032
- componentClassPosition: "start",
1033
- order: "strict",
1034
- unknownClassOrder: "asc",
1035
- unknownClassPosition: "start"
1036
- }],
1037
- "tailwind/enforce-consistent-line-wrapping": ["error", { group: "emptyLine" }],
1038
- "tailwind/enforce-consistent-variant-order": "error",
1039
- "tailwind/enforce-logical-properties": "error"
1040
- },
1041
- settings: { "better-tailwindcss": resolved }
1042
- }
1043
- ];
1044
- }
1045
- //#endregion
1046
- //#region src/configs/test.ts
1047
- /**
1048
- * Constructs the flat config items for test linting, extending
1049
- * the recommended Vitest rule sets.
1050
- * @returns Promise resolving to test ESLint config items.
1051
- */
1052
- async function test() {
1053
- const testPlugin = await importModule(import("@vitest/eslint-plugin"));
1054
- const files = [testGlob];
1055
- const recommendedConfig = testPlugin.configs.recommended;
1056
- const { rules } = recommendedConfig;
1057
- return [{
1058
- ...omit(recommendedConfig, ["rules", "name"]),
1059
- name: "favorodera/test/setup"
1060
- }, {
1061
- files,
1062
- name: "favorodera/test/rules",
1063
- rules: {
1064
- ...rules,
1065
- "test/consistent-each-for": ["error", {
1066
- describe: "for",
1067
- it: "for",
1068
- suite: "for",
1069
- test: "for"
1070
- }],
1071
- "test/consistent-test-it": ["error", {
1072
- fn: "it",
1073
- withinDescribe: "it"
1074
- }],
1075
- "test/consistent-vitest-vi": "error",
1076
- "test/hoisted-apis-on-top": "error",
1077
- "test/max-expects": "error",
1078
- "test/max-nested-describe": "error",
1079
- "test/no-alias-methods": "error",
1080
- "test/no-conditional-in-test": "error",
1081
- "test/no-conditional-tests": "error",
1082
- "test/no-duplicate-hooks": "error",
1083
- "test/no-hooks": "error",
1084
- "test/no-large-snapshots": "warn",
1085
- "test/no-test-prefixes": "error",
1086
- "test/no-test-return-statement": "error",
1087
- "test/padding-around-all": "error",
1088
- "test/prefer-called-times": "error",
1089
- "test/prefer-called-with": "error",
1090
- "test/prefer-comparison-matcher": "error",
1091
- "test/prefer-each": "error",
1092
- "test/prefer-equality-matcher": "error",
1093
- "test/prefer-expect-resolves": "error",
1094
- "test/prefer-expect-type-of": "error",
1095
- "test/prefer-hooks-in-order": "error",
1096
- "test/prefer-hooks-on-top": "error",
1097
- "test/prefer-import-in-mock": "error",
1098
- "test/prefer-importing-vitest-globals": "error",
1099
- "test/prefer-lowercase-title": "error",
1100
- "test/prefer-mock-promise-shorthand": "error",
1101
- "test/prefer-mock-return-shorthand": "error",
1102
- "test/prefer-snapshot-hint": "error",
1103
- "test/prefer-spy-on": "error",
1104
- "test/prefer-strict-boolean-matchers": "error",
1105
- "test/prefer-strict-equal": "error",
1106
- "test/prefer-to-be": "error",
1107
- "test/prefer-to-be-object": "error",
1108
- "test/prefer-to-contain": "error",
1109
- "test/prefer-to-have-been-called-times": "error",
1110
- "test/prefer-to-have-length": "error",
1111
- "test/prefer-todo": "error",
1112
- "test/prefer-vi-mocked": "error",
1113
- "test/require-awaited-expect-poll": "error",
1114
- "test/require-hook": "error",
1115
- "test/require-to-throw-message": "error",
1116
- "test/require-top-level-describe": "error",
1117
- "test/warn-todo": "warn"
1118
- }
1119
- }];
1120
- }
1121
- //#endregion
1122
- //#region src/configs/typescript.ts
1123
- /**
1124
- * Constructs the flat config items for TypeScript linting, initializing the parser
1125
- * and extending the recommended and strict type-aware rule sets.
1126
- * @returns Promise resolving to TypeScript ESLint config items.
1127
- */
1128
- async function typescript() {
1129
- const tsEsLint = await importModule(import("typescript-eslint"));
1130
- const files = [tsGlob];
1131
- const [baseConfig, eslintRecommended, strictConfig] = tsEsLint.configs.strict;
1132
- const stylisticConfig = tsEsLint.configs.stylistic[2];
1133
- const baseRest = omit(baseConfig, ["rules", "name"]);
1134
- const rules = {
1135
- ...eslintRecommended?.rules,
1136
- ...strictConfig?.rules,
1137
- ...stylisticConfig?.rules
1138
- };
1139
- return [{
1140
- ...baseRest,
1141
- name: "favorodera/typescript/setup"
1142
- }, {
1143
- files,
1144
- name: "favorodera/typescript/rules",
1145
- rules: {
1146
- ...rules,
1147
- "ts/array-type": ["error", {
1148
- default: "generic",
1149
- readonly: "generic"
1150
- }],
1151
- "ts/consistent-type-imports": "error",
1152
- "ts/default-param-last": "error",
1153
- "ts/method-signature-style": "error",
1154
- "ts/no-import-type-side-effects": "error",
1155
- "ts/no-redeclare": "error"
1156
- }
1157
- }];
1158
- }
1159
- //#endregion
1160
- //#region src/configs/unicorn.ts
1161
- /**
1162
- * Constructs the flat config items for Unicorn linting, providing a collection of
1163
- * awesome ESLint rules to improve code quality and enforce best practices.
1164
- * @returns Promise resolving to Unicorn ESLint config items.
1165
- */
1166
- async function unicorn() {
1167
- const unicornPlugin = await importModule(import("eslint-plugin-unicorn"));
1168
- const files = [
1169
- jsGlob,
1170
- tsGlob,
1171
- vueGlob
1172
- ];
1173
- const recommendedConfig = unicornPlugin.configs.recommended;
1174
- const { rules = {} } = recommendedConfig;
1175
- return [{
1176
- ...omit(recommendedConfig, [
1177
- "rules",
1178
- "files",
1179
- "name"
1180
- ]),
1181
- name: "favorodera/unicorn/setup"
1182
- }, {
1183
- files,
1184
- name: "favorodera/unicorn/rules",
1185
- rules: {
1186
- ...rules,
1187
- "unicorn/single-line-block-comment-style": ["error", "single-line"]
1188
- }
1189
- }];
1190
- }
1191
- //#endregion
1192
- //#region src/configs/unused-imports.ts
1193
- /**
1194
- * Constructs the flat config items for unused imports linting, providing plugin setup and
1195
- * specific rules to detect and remove unused imports and variables.
1196
- * @returns Promise resolving to unused imports ESLint config items.
1197
- */
1198
- async function unusedImports() {
1199
- return [{
1200
- name: "favorodera/unused-imports/setup",
1201
- plugins: { "unused-imports": await importModule(import("eslint-plugin-unused-imports")) }
1202
- }, {
1203
- files: [
1204
- jsGlob,
1205
- tsGlob,
1206
- vueGlob
1207
- ],
1208
- name: "favorodera/unused-imports/rules",
1209
- rules: {
1210
- "unused-imports/no-unused-imports": "error",
1211
- "unused-imports/no-unused-vars": ["error", {
1212
- args: "after-used",
1213
- argsIgnorePattern: "^_",
1214
- ignoreRestSiblings: true,
1215
- vars: "all",
1216
- varsIgnorePattern: "^_"
1217
- }]
1218
- }
1219
- }];
1220
- }
1221
- //#endregion
1222
- //#region src/configs/vue.ts
1223
- const sfcBlocksDefaults = { blocks: {
1224
- customBlocks: true,
1225
- styles: true,
1226
- template: false
1227
- } };
1228
- const vueDefaults = { sfcBlocks: sfcBlocksDefaults };
1229
- /**
1230
- * Constructs the flat config items for Vue and accessibility linting, setting up the custom template parser,
1231
- * Vue block processors, and rules to enforce recommended component syntax.
1232
- * @param options Vue configuration options.
1233
- * @returns Promise resolving to Vue ESLint config items.
1234
- */
1235
- async function vue(options) {
1236
- const sfcBlocks = resolveOptions(defu(options, vueDefaults).sfcBlocks, sfcBlocksDefaults);
1237
- const [vuePlugin, vueParser, tsEsLint, a11yPlugin] = await Promise.all([
1238
- importModule(import("eslint-plugin-vue")),
1239
- importModule(import("vue-eslint-parser")),
1240
- importModule(import("typescript-eslint")),
1241
- importModule(import("eslint-plugin-vuejs-accessibility"))
1242
- ]);
1243
- const vueRecommendedConfig = vuePlugin.configs["flat/recommended-error"];
1244
- const a11yRecommendedConfig = a11yPlugin.configs["flat/recommended"];
1245
- const [vueBase] = vueRecommendedConfig;
1246
- const vueBaseRest = omit(vueBase, [
1247
- "rules",
1248
- "files",
1249
- "name"
1250
- ]);
1251
- const vueRules = extractRules(vueRecommendedConfig);
1252
- const [a11yBase] = a11yRecommendedConfig;
1253
- const a11yBaseRest = omit(a11yBase, ["name"]);
1254
- const a11yRules = extractRules(a11yRecommendedConfig);
1255
- const processor = sfcBlocks === false ? vuePlugin.processors[".vue"] : mergeProcessors([vuePlugin.processors[".vue"], vueBlocksProcessor(sfcBlocks)]);
1256
- return [
1257
- {
1258
- ...vueBaseRest,
1259
- languageOptions: { globals: {
1260
- computed: "readonly",
1261
- defineEmits: "readonly",
1262
- defineExpose: "readonly",
1263
- defineProps: "readonly",
1264
- onMounted: "readonly",
1265
- onUnmounted: "readonly",
1266
- reactive: "readonly",
1267
- ref: "readonly",
1268
- shallowReactive: "readonly",
1269
- shallowRef: "readonly",
1270
- toRef: "readonly",
1271
- toRefs: "readonly",
1272
- watch: "readonly",
1273
- watchEffect: "readonly"
1274
- } },
1275
- name: "favorodera/vue/setup"
1276
- },
1277
- {
1278
- ...a11yBaseRest,
1279
- name: "favorodera/vue/a11y/setup"
1280
- },
1281
- {
1282
- files: [vueGlob],
1283
- languageOptions: {
1284
- parser: vueParser,
1285
- parserOptions: {
1286
- extraFileExtensions: [".vue"],
1287
- parser: tsEsLint.parser,
1288
- sourceType: "module"
1289
- }
1290
- },
1291
- name: "favorodera/vue/rules",
1292
- processor,
1293
- rules: {
1294
- ...vueRules,
1295
- "vue/block-lang": ["error", { script: { lang: "ts" } }],
1296
- "vue/block-order": ["error", { order: [
1297
- "script",
1298
- "template",
1299
- "style"
1300
- ] }],
1301
- "vue/block-tag-newline": ["error", {
1302
- multiline: "always",
1303
- singleline: "always"
1304
- }],
1305
- "vue/comment-directive": ["error", { reportUnusedDisableDirectives: true }],
1306
- "vue/define-macros-order": ["error", {
1307
- defineExposeLast: true,
1308
- order: [
1309
- "defineOptions",
1310
- "definePage",
1311
- "defineSlots",
1312
- "defineEmits",
1313
- "defineProps",
1314
- "defineModel"
1315
- ]
1316
- }],
1317
- "vue/define-props-declaration": ["error", "type-based"],
1318
- "vue/define-props-destructuring": ["error", { destructure: "never" }],
1319
- "vue/next-tick-style": ["error", "promise"],
1320
- "vue/no-import-compiler-macros": "error",
1321
- "vue/no-negated-v-if-condition": "error",
1322
- "vue/no-reserved-component-names": ["error", {
1323
- disallowVue3BuiltInComponents: true,
1324
- disallowVueBuiltInComponents: true,
1325
- htmlElementCaseSensitive: false
1326
- }],
1327
- "vue/no-root-v-if": "error",
1328
- "vue/no-template-target-blank": "error",
1329
- "vue/no-unused-emit-declarations": "error",
1330
- "vue/no-unused-properties": "error",
1331
- "vue/no-unused-refs": "error",
1332
- "vue/no-use-v-else-with-v-for": "error",
1333
- "vue/no-useless-mustaches": "error",
1334
- "vue/no-useless-v-bind": "error",
1335
- "vue/padding-line-between-blocks": "error",
1336
- "vue/padding-line-between-tags": ["error", [
1337
- {
1338
- blankLine: "always",
1339
- next: "*:multi-line",
1340
- prev: "*:single-line"
1341
- },
1342
- {
1343
- blankLine: "always",
1344
- next: "*:single-line",
1345
- prev: "*:multi-line"
1346
- },
1347
- {
1348
- blankLine: "always",
1349
- next: "*:multi-line",
1350
- prev: "*:multi-line"
1351
- },
1352
- {
1353
- blankLine: "never",
1354
- next: "*:single-line",
1355
- prev: "*:single-line"
1356
- }
1357
- ]],
1358
- "vue/prefer-prop-type-boolean-first": "error",
1359
- "vue/prefer-separate-static-class": "error",
1360
- "vue/prefer-single-event-payload": "error",
1361
- "vue/prefer-use-template-ref": "error",
1362
- "vue/slot-name-casing": ["error", "kebab-case"],
1363
- "vue/v-for-delimiter-style": ["error", "in"]
1364
- }
1365
- },
1366
- {
1367
- files: [vueGlob],
1368
- name: "favorodera/vue/a11y/rules",
1369
- rules: {
1370
- ...a11yRules,
1371
- "vue-a11y/form-control-has-label": ["error", {
1372
- controlComponents: [],
1373
- labelComponents: []
1374
- }],
1375
- "vue-a11y/label-has-for": ["error", {
1376
- allowChildren: true,
1377
- components: [],
1378
- controlComponents: [],
1379
- required: { some: ["nesting", "id"] }
1380
- }],
1381
- "vue-a11y/no-aria-hidden-on-focusable": "error",
1382
- "vue-a11y/no-role-presentation-on-focusable": "error"
1383
- }
1384
- }
1385
- ];
1386
- }
1387
- //#endregion
1388
- //#region src/configs/yaml.ts
1389
- /**
1390
- * Constructs the flat config items for YAML linting, setting up
1391
- * the custom parser and rule validations.
1392
- * @returns Promise resolving to YAML ESLint config items.
1393
- */
1394
- async function yaml() {
1395
- const [yamlPlugin, yamlParser] = await Promise.all([importModule(import("eslint-plugin-yml")), importModule(import("yaml-eslint-parser"))]);
1396
- const standardConfig = yamlPlugin.configs.standard;
1397
- const [pluginConfig] = standardConfig;
1398
- const pluginRest = omit(pluginConfig, [
1399
- "rules",
1400
- "files",
1401
- "name"
1402
- ]);
1403
- const rules = extractRules(standardConfig);
1404
- return [
1405
- {
1406
- ...pluginRest,
1407
- name: "favorodera/yaml/setup"
1408
- },
1409
- {
1410
- files: [yamlGlob],
1411
- language: "yaml/yaml",
1412
- languageOptions: { parser: yamlParser },
1413
- name: "favorodera/yaml/rules",
1414
- rules: {
1415
- ...rules,
1416
- "yaml/quotes": ["error", {
1417
- avoidEscape: true,
1418
- prefer: "single"
1419
- }],
1420
- "yaml/require-string-key": "error"
1421
- }
1422
- },
1423
- {
1424
- files: [pnpmWorkspaceGlob],
1425
- language: "yaml/yaml",
1426
- languageOptions: { parser: yamlParser },
1427
- name: "favorodera/yaml/sort/pnpm-workspace-yaml",
1428
- rules: { "yaml/sort-keys": [
1429
- "error",
1430
- {
1431
- order: [
1432
- "cacheDir",
1433
- "catalogMode",
1434
- "cleanupUnusedCatalogs",
1435
- "dedupeDirectDeps",
1436
- "deployAllFiles",
1437
- "enablePrePostScripts",
1438
- "engineStrict",
1439
- "extendNodePath",
1440
- "hoist",
1441
- "hoistPattern",
1442
- "hoistWorkspacePackages",
1443
- "ignoreCompatibilityDb",
1444
- "ignoreDepScripts",
1445
- "ignoreScripts",
1446
- "ignoreWorkspaceRootCheck",
1447
- "managePackageManagerVersions",
1448
- "minimumReleaseAge",
1449
- "minimumReleaseAgeExclude",
1450
- "modulesDir",
1451
- "nodeLinker",
1452
- "nodeVersion",
1453
- "optimisticRepeatInstall",
1454
- "packageManagerStrict",
1455
- "packageManagerStrictVersion",
1456
- "preferSymlinkedExecutables",
1457
- "preferWorkspacePackages",
1458
- "publicHoistPattern",
1459
- "registrySupportsTimeField",
1460
- "requiredScripts",
1461
- "resolutionMode",
1462
- "savePrefix",
1463
- "scriptShell",
1464
- "shamefullyHoist",
1465
- "shellEmulator",
1466
- "stateDir",
1467
- "supportedArchitectures",
1468
- "symlink",
1469
- "tag",
1470
- "trustPolicy",
1471
- "trustPolicyExclude",
1472
- "updateNotifier",
1473
- "packages",
1474
- "overrides",
1475
- "patchedDependencies",
1476
- "catalog",
1477
- "catalogs",
1478
- "allowedDeprecatedVersions",
1479
- "allowNonAppliedPatches",
1480
- "configDependencies",
1481
- "ignoredBuiltDependencies",
1482
- "ignoredOptionalDependencies",
1483
- "neverBuiltDependencies",
1484
- "onlyBuiltDependencies",
1485
- "onlyBuiltDependenciesFile",
1486
- "packageExtensions",
1487
- "peerDependencyRules"
1488
- ],
1489
- pathPattern: "^$"
1490
- },
1491
- {
1492
- order: { type: "asc" },
1493
- pathPattern: ".*"
1494
- }
1495
- ] }
1496
- }
1497
- ];
1498
- }
1499
- //#endregion
1500
- //#region src/factory.ts
1501
- /**
1502
- * Factory to create a flat ESLint config.
1503
- * It builds an ESLint config by sequentially adding sub-configs based on the provided options.
1504
- * @param options Configuration options for enabling/disabling or configuring specific rule sets.
1505
- * @returns A flat config composer instance that can be exported directly or further modified.
1506
- */
1507
- function factory(options = {}) {
1508
- const configs = [ignores(options.ignores)];
1509
- const configFunctions = {
1510
- imports,
1511
- javascript,
1512
- jsdoc,
1513
- jsonc,
1514
- markdown,
1515
- node,
1516
- perfectionist,
1517
- pnpm,
1518
- stylistic,
1519
- tailwind,
1520
- test,
1521
- typescript,
1522
- unicorn,
1523
- unusedImports,
1524
- vue,
1525
- yaml
1526
- };
1527
- for (const [key, configFunction] of Object.entries(configFunctions)) {
1528
- const configOption = options[key];
1529
- const resolved = resolveOptions(configOption ?? true, {});
1530
- if (resolved) configs.push(configFunction(resolved));
1531
- }
1532
- let composer = new FlatConfigComposer();
1533
- composer = composer.append(...configs).append(...disables()).renamePlugins({
1534
- "@typescript-eslint": "ts",
1535
- "better-tailwindcss": "tailwind",
1536
- "import-lite": "import",
1537
- "markdown": "md",
1538
- "n": "node",
1539
- "vitest": "test",
1540
- "vuejs-accessibility": "vue-a11y",
1541
- "yml": "yaml"
1542
- });
1543
- return composer;
1544
- }
1545
- //#endregion
1546
- export { codeInMdGlob, extractRules, factory, ignoresGlob, importModule, jsGlob, json5Glob, jsonGlob, jsoncGlob, mdGlob, mdInMdGlob, omit, packageJsonGlob, pnpmWorkspaceGlob, scriptsGlob, testGlob, tsConfigGlob, tsGlob, vueGlob, yamlGlob };
1
+ import{FlatConfigComposer as e}from"eslint-flat-config-utils";import{defu as t}from"defu";import n from"globals";import{mergeProcessors as r,processorPassThrough as i}from"eslint-merge-processors";import a from"eslint-processor-vue-blocks";const o=`**/*.{js,cjs,mjs}`,s=`**/*.{ts,cts,mts}`,c=`**/*.vue`,l=`**/*.md`,u=`**/*.md/*.md`,d=`**/*.md/**/*.{js,cjs,mjs,ts,cts,mts,vue}`,f=`**/*.{js,cjs,mjs,ts,cts,mts}`,p=`**/*.{test,spec,bench,benchmark}.{js,cjs,mjs,ts,cts,mts}`,m=`**/*.json`,h=`**/*.json5`,g=`**/*.jsonc`,_=[`**/tsconfig.json`,`**/tsconfig.*.json`],v=`**/*.{yml,yaml}`,y=`pnpm-workspace.yaml`,b=`**/package.json`,x=`**/node_modules/**,**/dist/**,**/package-lock.json,**/yarn.lock,**/pnpm-lock.yaml,**/bun.lockb,**/output,**/coverage,**/temp,**/.temp,**/tmp,**/.tmp,**/.history,**/.vitepress/cache,**/.nuxt,**/.next,**/.svelte-kit,**/.vercel,**/.changeset,**/.idea,**/.cache,**/.output,**/.vite-inspect,**/.yarn,**/CHANGELOG*.md,**/LICENSE*,**/*.min.*,**/__snapshots__,**/vite.config.*.timestamp-*,**/auto-import?(s).d.ts,**/components.d.ts,**/.context,**/.claude,**/.agents,**/.*/skills`.split(`,`);function S(){return[{files:[h,g,m],name:`favorodera/disables/jsonc`,rules:{"no-irregular-whitespace":`off`}},{files:[l],ignores:[u],name:`favorodera/disables/markdown`,rules:{"md/no-missing-atx-heading-space":`off`}},{files:[d],languageOptions:{parserOptions:{ecmaFeatures:{impliedStrict:!0}}},name:`favorodera/disables/code-in-markdown`,rules:{"no-alert":`off`,"no-console":`off`,"no-continue":`off`,"no-labels":`off`,"no-lone-blocks":`off`,"no-restricted-syntax":`off`,"no-undef":`off`,"no-unused-expressions":`off`,"no-unused-labels":`off`,"no-unused-vars":`off`,"unicode-bom":`off`,"node/no-extraneous-import":`off`,"node/prefer-global/process":`off`,"style/comma-dangle":`off`,"style/eol-last":`off`,"style/line-comment-position":`off`,"style/padding-line-between-statements":`off`,"ts/consistent-type-imports":`off`,"ts/explicit-function-return-type":`off`,"ts/no-namespace":`off`,"ts/no-redeclare":`off`,"ts/no-require-imports":`off`,"ts/no-unused-expressions":`off`,"ts/no-unused-vars":`off`,"ts/no-use-before-define":`off`,"unused-imports/no-unused-imports":`off`,"unused-imports/no-unused-vars":`off`,"vue/no-unused-vars":`off`,"jsdoc/require-jsdoc":`off`}},{files:[o,s,c],name:`favorodera/disables/js-ts-vue`,rules:{"jsdoc/require-throws-type":`off`,"node/no-missing-import":`off`,"node/no-missing-require":`off`,"node/no-process-exit":`off`,"tailwind/enforce-consistent-important-position":`off`,"tailwind/enforce-consistent-variable-syntax":`off`,"tailwind/enforce-shorthand-classes":`off`,"unicorn/filename-case":`off`,"unicorn/name-replacements":`off`,"unicorn/no-process-exit":`off`,"no-continue":`off`,"no-unused-vars":`off`,"ts/no-unused-vars":`off`}},{files:[c],name:`favorodera/disables/vue`,rules:{"vue/multi-word-component-names":`off`}},{files:[p],name:`favorodera/disables/test`,rules:{"no-unused-expressions":`off`}}]}const C=x;function w(e=[]){return[{ignores:typeof e==`function`?e(C):[...C,...e],name:`favorodera/ignores`}]}function T(...e){return Object.assign({},...e.flat().map(e=>e?.rules||{}))}async function E(e){let t=await e;return typeof t==`object`&&t&&`default`in t?t.default:t}function D(e,n){return e?t(e===!0?{}:e,n):!1}function O(e,t){let n={...e};for(let e of t)Reflect.deleteProperty(n,e);return n}async function k(){let e=await E(import(`eslint-plugin-import-lite`)),t=[o,s,c],n=e.configs.recommended,{rules:r={}}=n;return[{...O(n,[`rules`,`files`,`name`]),name:`favorodera/imports/setup`},{files:t,name:`favorodera/imports/rules`,rules:{...r,"import/consistent-type-specifier-style":[`error`,`prefer-top-level`],"import/first":`error`,"import/newline-after-import":[`error`,{count:1}],"import/no-duplicates":[`error`,{"prefer-inline":!0}],"import/no-mutable-exports":`error`,"import/no-named-default":`error`}}]}async function A(){let e=await E(import(`@eslint/js`)),t=[o,s,c];return[{languageOptions:{ecmaVersion:`latest`,globals:{...n.browser,...n.es2021,...n.node,document:`readonly`,navigator:`readonly`,window:`readonly`},sourceType:`module`},linterOptions:{reportUnusedDisableDirectives:!0},name:`favorodera/javascript/setup`},{files:t,name:`favorodera/javascript/rules`,rules:{...e.configs.recommended.rules,"array-callback-return":[`error`,{allowImplicit:!0}],"block-scoped-var":`error`,"default-case-last":`error`,"dot-notation":`error`,eqeqeq:`error`,"getter-return":[`error`,{allowImplicit:!0}],"new-cap":`error`,"no-alert":`error`,"no-array-constructor":`error`,"no-caller":`error`,"no-console":[`error`,{allow:[`warn`,`error`]}],"no-constructor-return":`error`,"no-continue":`error`,"no-else-return":`error`,"no-empty":[`error`,{allowEmptyCatch:!0}],"no-eq-null":`error`,"no-eval":`error`,"no-extend-native":`error`,"no-extra-bind":`error`,"no-implied-eval":`error`,"no-iterator":`error`,"no-labels":[`error`,{allowLoop:!1,allowSwitch:!1}],"no-lone-blocks":`error`,"no-loop-func":`error`,"no-multi-str":`error`,"no-negated-condition":`error`,"no-nested-ternary":`error`,"no-new":`error`,"no-new-func":`error`,"no-new-wrappers":`error`,"no-object-constructor":`error`,"no-octal-escape":`error`,"no-param-reassign":`error`,"no-promise-executor-return":`error`,"no-proto":`error`,"no-return-assign":`error`,"no-script-url":`error`,"no-self-compare":`error`,"no-sequences":`error`,"no-template-curly-in-string":`error`,"no-throw-literal":`error`,"no-undef-init":`error`,"no-unmodified-loop-condition":`error`,"no-unneeded-ternary":[`error`,{defaultAssignment:!1}],"no-unreachable-loop":`error`,"no-unused-expressions":[`error`,{allowShortCircuit:!0,allowTaggedTemplates:!0,allowTernary:!0}],"no-use-before-define":[`error`,{classes:!1,functions:!1}],"no-useless-call":`error`,"no-useless-computed-key":`error`,"no-useless-concat":`error`,"no-useless-constructor":`error`,"no-useless-rename":`error`,"no-useless-return":`error`,"object-shorthand":[`error`,`always`,{avoidQuotes:!0,ignoreConstructors:!1}],"one-var":[`error`,{initialized:`never`}],"prefer-arrow-callback":[`error`,{allowNamedFunctions:!1,allowUnboundThis:!0}],"prefer-const":[`error`,{destructuring:`all`,ignoreReadBeforeAssign:!0}],"prefer-exponentiation-operator":`error`,"prefer-promise-reject-errors":`error`,"prefer-regex-literals":[`error`,{disallowRedundantWrapping:!0}],"prefer-template":`error`,"symbol-description":`error`,"unicode-bom":`error`,"valid-typeof":[`error`,{requireStringLiterals:!0}],"vars-on-top":`error`,yoda:`error`}}]}async function j(){let e=await E(import(`eslint-plugin-jsdoc`)),t=[o,s,c],n=e.configs[`flat/recommended-typescript-error`],r=e.configs[`flat/stylistic-typescript-error`],{rules:i={}}=n,a=O(n,[`rules`,`files`,`name`]),{rules:l={}}=r,u=O(r,[`rules`,`files`,`name`]),d={...i,...l};return[{...a,name:`favorodera/jsdoc/recommended/setup`},{...u,name:`favorodera/jsdoc/stylistic/setup`},{files:t,name:`favorodera/jsdoc/rules`,rules:{...d,"jsdoc/check-indentation":`error`,"jsdoc/check-template-names":`error`,"jsdoc/imports-as-dependencies":`error`,"jsdoc/lines-before-block":[`error`,{ignoreSingleLines:!1}],"jsdoc/multiline-blocks":`error`,"jsdoc/no-bad-blocks":`error`,"jsdoc/no-blank-block-descriptions":`error`,"jsdoc/no-blank-blocks":`error`,"jsdoc/sort-tags":`error`}}]}async function M(){return[{name:`favorodera/jsonc/setup`,plugins:{jsonc:await E(import(`eslint-plugin-jsonc`))}},{files:[h,g,m],language:`jsonc/x`,name:`favorodera/jsonc/rules`,rules:{"jsonc/array-bracket-newline":`error`,"jsonc/array-bracket-spacing":[`error`,`never`],"jsonc/array-element-newline":`error`,"jsonc/comma-dangle":[`error`,`never`],"jsonc/comma-style":[`error`,`last`],"jsonc/indent":[`error`,2],"jsonc/key-spacing":[`error`,{afterColon:!0,beforeColon:!1}],"jsonc/no-bigint-literals":`error`,"jsonc/no-binary-expression":`error`,"jsonc/no-binary-numeric-literals":`error`,"jsonc/no-dupe-keys":`error`,"jsonc/no-escape-sequence-in-identifier":`error`,"jsonc/no-floating-decimal":`error`,"jsonc/no-hexadecimal-numeric-literals":`error`,"jsonc/no-infinity":`error`,"jsonc/no-irregular-whitespace":`error`,"jsonc/no-multi-str":`error`,"jsonc/no-nan":`error`,"jsonc/no-number-props":`error`,"jsonc/no-numeric-separators":`error`,"jsonc/no-octal":`error`,"jsonc/no-octal-escape":`error`,"jsonc/no-octal-numeric-literals":`error`,"jsonc/no-parenthesized":`error`,"jsonc/no-plus-sign":`error`,"jsonc/no-regexp-literals":`error`,"jsonc/no-sparse-arrays":`error`,"jsonc/no-template-literals":`error`,"jsonc/no-undefined-value":`error`,"jsonc/no-unicode-codepoint-escapes":`error`,"jsonc/no-useless-escape":`error`,"jsonc/object-curly-newline":[`error`,{consistent:!0,multiline:!0}],"jsonc/object-curly-spacing":[`error`,`always`],"jsonc/object-property-newline":[`error`,{allowAllPropertiesOnSameLine:!1}],"jsonc/quote-props":`error`,"jsonc/quotes":`error`,"jsonc/space-unary-ops":`error`,"jsonc/valid-json-number":`error`,"jsonc/vue-custom-block/no-parsing-error":`error`}},{files:[b],name:`favorodera/jsonc/sort/package-json`,rules:{"jsonc/sort-array-values":[`error`,{order:{type:`asc`},pathPattern:`^files$`}],"jsonc/sort-keys":[`error`,{order:`publisher.name.displayName.type.version.private.packageManager.description.author.contributors.license.funding.homepage.repository.bugs.keywords.categories.sideEffects.imports.exports.main.module.unpkg.jsdelivr.types.typesVersions.bin.icon.files.engines.activationEvents.contributes.scripts.peerDependencies.peerDependenciesMeta.dependencies.optionalDependencies.devDependencies.pnpm.overrides.resolutions.husky.simple-git-hooks.lint-staged.eslintConfig`.split(`.`),pathPattern:`^$`},{order:{type:`asc`},pathPattern:`^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$`},{order:{type:`asc`},pathPattern:`^(?:resolutions|overrides|pnpm.overrides)$`},{order:{type:`asc`},pathPattern:String.raw`^workspaces\.catalog$`},{order:{type:`asc`},pathPattern:String.raw`^workspaces\.catalogs\.[^.]+$`},{order:[`types`,`import`,`require`,`default`],pathPattern:`^exports.*$`},{order:[`pre-commit`,`prepare-commit-msg`,`commit-msg`,`post-commit`,`pre-rebase`,`post-rewrite`,`post-checkout`,`post-merge`,`pre-push`,`pre-auto-gc`],pathPattern:`^(?:gitHooks|husky|simple-git-hooks)$`}]}},{files:_,name:`favorodera/jsonc/sort/tsconfig-json`,rules:{"jsonc/sort-keys":[`error`,{order:[`extends`,`compilerOptions`,`references`,`files`,`include`,`exclude`],pathPattern:`^$`},{order:`incremental.composite.tsBuildInfoFile.disableSourceOfProjectReferenceRedirect.disableSolutionSearching.disableReferencedProjectLoad.target.jsx.jsxFactory.jsxFragmentFactory.jsxImportSource.lib.moduleDetection.noLib.reactNamespace.useDefineForClassFields.emitDecoratorMetadata.experimentalDecorators.libReplacement.baseUrl.rootDir.rootDirs.customConditions.module.moduleResolution.moduleSuffixes.noResolve.paths.resolveJsonModule.resolvePackageJsonExports.resolvePackageJsonImports.typeRoots.types.allowArbitraryExtensions.allowImportingTsExtensions.allowUmdGlobalAccess.allowJs.checkJs.maxNodeModuleJsDepth.strict.strictBindCallApply.strictFunctionTypes.strictNullChecks.strictPropertyInitialization.allowUnreachableCode.allowUnusedLabels.alwaysStrict.exactOptionalPropertyTypes.noFallthroughCasesInSwitch.noImplicitAny.noImplicitOverride.noImplicitReturns.noImplicitThis.noPropertyAccessFromIndexSignature.noUncheckedIndexedAccess.noUnusedLocals.noUnusedParameters.useUnknownInCatchVariables.declaration.declarationDir.declarationMap.downlevelIteration.emitBOM.emitDeclarationOnly.importHelpers.importsNotUsedAsValues.inlineSourceMap.inlineSources.mapRoot.newLine.noEmit.noEmitHelpers.noEmitOnError.outDir.outFile.preserveConstEnums.preserveValueImports.removeComments.sourceMap.sourceRoot.stripInternal.allowSyntheticDefaultImports.esModuleInterop.forceConsistentCasingInFileNames.isolatedDeclarations.isolatedModules.preserveSymlinks.verbatimModuleSyntax.erasableSyntaxOnly.skipDefaultLibCheck.skipLibCheck`.split(`.`),pathPattern:`^compilerOptions$`}]}}]}const N={gfm:!0};async function P(e){let n=t(e,N),a=await E(import(`@eslint/markdown`)),[o]=a.configs.recommended,{rules:s={}}=o;return[{...O(o,[`rules`,`files`,`name`,`language`]),name:`favorodera/markdown/setup`},{files:[l],ignores:[u],language:n.gfm?`md/gfm`:`md/commonmark`,languageOptions:{frontmatter:`yaml`},name:`favorodera/markdown/rules`,processor:r([a.processors?.markdown,i]),rules:s}]}async function F(){let e=await E(import(`eslint-plugin-n`)),t=[o,s,c],n=e.configs[`flat/recommended-module`],{rules:r={}}=n;return[{...O(n,[`rules`,`files`,`name`]),name:`favorodera/node/setup`},{files:t,name:`favorodera/node/rules`,rules:{...r,"node/callback-return":`error`,"node/handle-callback-err":[`error`,`^(err|error)$`],"node/no-callback-literal":`error`,"node/no-new-require":`error`,"node/no-path-concat":`error`,"node/no-unpublished-import":`error`,"node/prefer-global/buffer":`error`,"node/prefer-global/console":`error`,"node/prefer-global/crypto":`error`,"node/prefer-global/process":`error`,"node/prefer-global/text-decoder":`error`,"node/prefer-global/text-encoder":`error`,"node/prefer-global/timers":`error`,"node/prefer-global/url":`error`,"node/prefer-global/url-search-params":`error`,"node/prefer-node-protocol":`error`,"node/prefer-promises/dns":`error`,"node/prefer-promises/fs":`error`}}]}const I={ignoreCase:!0,locales:`en-US`,newlinesBetween:`ignore`,newlinesInside:`ignore`,order:`asc`,partitionByComment:!0,partitionByNewLine:!0,specialCharacters:`keep`,type:`natural`};async function L(e){let n=t(e,I),r=await E(import(`eslint-plugin-perfectionist`)),i=[o,s,c],a=n.type??`natural`,l=r.configs[`recommended-${a}`],{rules:u={}}=l;return[{...O(l,[`rules`,`settings`,`files`,`name`]),name:`favorodera/perfectionist/setup`,settings:{perfectionist:n}},{files:i,name:`favorodera/perfectionist/rules`,rules:u}]}async function R(){let[e,t]=await Promise.all([E(import(`eslint-plugin-pnpm`)),E(import(`yaml-eslint-parser`))]);return[{name:`favorodera/pnpm/setup`,plugins:{pnpm:e}},{files:[b],language:`jsonc/x`,name:`favorodera/pnpm/package-json`,rules:{"pnpm/json-enforce-catalog":[`error`,{autofix:!1,fields:[`dependencies`,`devDependencies`,`optionalDependencies`,`peerDependencies`],ignores:[`@types/vscode`]}],"pnpm/json-prefer-workspace-settings":[`error`,{autofix:!0}],"pnpm/json-valid-catalog":[`error`,{autofix:!1}]}},{files:[y],languageOptions:{parser:t},name:`favorodera/pnpm/pnpm-workspace-yaml`,rules:{"pnpm/yaml-enforce-settings":[`error`,{settings:{allowBuilds:{"@parcel/watcher":!0,"@tailwindcss/oxide":!0,"better-sqlite3":!0,esbuild:!0,sharp:!0,"unrs-resolver":!0,"vue-demi":!0},shellEmulator:!0,trustPolicy:`no-downgrade`}}],"pnpm/yaml-no-duplicate-catalog-item":[`error`,{checkDuplicates:`exact-version`}],"pnpm/yaml-no-unused-catalog-item":`error`,"pnpm/yaml-valid-packages":`error`}}]}const z={braceStyle:`1tbs`,experimental:!1,indent:2,jsx:!1,quotes:`single`,semi:!1};async function B(e){let n=t(e,z),r=await E(import(`@stylistic/eslint-plugin`)),i=[o,s,c],a=r.configs.customize({pluginName:`style`,...n}),{rules:l={}}=a;return[{...O(a,[`rules`,`files`,`name`]),name:`favorodera/stylistic/setup`},{files:i,name:`favorodera/stylistic/rules`,rules:{...l,"style/array-bracket-newline":`error`,"style/array-element-newline":[`error`,`consistent`],"style/curly-newline":[`error`,`always`],"style/function-call-argument-newline":[`error`,`consistent`],"style/function-call-spacing":`error`,"style/function-paren-newline":`error`,"style/implicit-arrow-linebreak":`error`,"style/line-comment-position":`error`,"style/linebreak-style":`error`,"style/multiline-comment-style":[`error`,`separate-lines`],"style/newline-per-chained-call":`error`,"style/no-confusing-arrow":`error`,"style/no-extra-semi":`error`,"style/nonblock-statement-body-position":`error`,"style/object-curly-newline":`error`,"style/semi-style":`error`,"style/switch-colon-spacing":`error`,"style/wrap-regex":`error`}}]}const V={detectComponentClasses:!0};async function H(e){let n=t(e,V),r=await E(import(`eslint-plugin-better-tailwindcss`)),i=[o,s,c],a=r.configs[`recommended-error`],l=r.configs[`stylistic-error`],{rules:u}=a,d=O(a,[`rules`]),{rules:f}=l,p=O(l,[`rules`]),m={...u,...f};return[{...d,name:`favorodera/tailwind/recommended/setup`},{...p,name:`favorodera/tailwind/stylistic/setup`},{files:i,name:`favorodera/tailwind/rules`,rules:{...m,"tailwind/enforce-consistent-class-order":[`error`,{componentClassOrder:`asc`,componentClassPosition:`start`,order:`strict`,unknownClassOrder:`asc`,unknownClassPosition:`start`}],"tailwind/enforce-consistent-line-wrapping":[`error`,{group:`emptyLine`}],"tailwind/enforce-consistent-variant-order":`error`,"tailwind/enforce-logical-properties":`error`},settings:{"better-tailwindcss":n}}]}async function U(){let e=await E(import(`@vitest/eslint-plugin`)),t=[p],n=e.configs.recommended,{rules:r}=n;return[{...O(n,[`rules`,`name`]),name:`favorodera/test/setup`},{files:t,name:`favorodera/test/rules`,rules:{...r,"test/consistent-each-for":[`error`,{describe:`for`,it:`for`,suite:`for`,test:`for`}],"test/consistent-test-it":[`error`,{fn:`it`,withinDescribe:`it`}],"test/consistent-vitest-vi":`error`,"test/hoisted-apis-on-top":`error`,"test/max-expects":`error`,"test/max-nested-describe":`error`,"test/no-alias-methods":`error`,"test/no-conditional-in-test":`error`,"test/no-conditional-tests":`error`,"test/no-duplicate-hooks":`error`,"test/no-hooks":`error`,"test/no-large-snapshots":`warn`,"test/no-test-prefixes":`error`,"test/no-test-return-statement":`error`,"test/padding-around-all":`error`,"test/prefer-called-times":`error`,"test/prefer-called-with":`error`,"test/prefer-comparison-matcher":`error`,"test/prefer-each":`error`,"test/prefer-equality-matcher":`error`,"test/prefer-expect-resolves":`error`,"test/prefer-expect-type-of":`error`,"test/prefer-hooks-in-order":`error`,"test/prefer-hooks-on-top":`error`,"test/prefer-import-in-mock":`error`,"test/prefer-importing-vitest-globals":`error`,"test/prefer-lowercase-title":`error`,"test/prefer-mock-promise-shorthand":`error`,"test/prefer-mock-return-shorthand":`error`,"test/prefer-snapshot-hint":`error`,"test/prefer-spy-on":`error`,"test/prefer-strict-boolean-matchers":`error`,"test/prefer-strict-equal":`error`,"test/prefer-to-be":`error`,"test/prefer-to-be-object":`error`,"test/prefer-to-contain":`error`,"test/prefer-to-have-been-called-times":`error`,"test/prefer-to-have-length":`error`,"test/prefer-todo":`error`,"test/prefer-vi-mocked":`error`,"test/require-awaited-expect-poll":`error`,"test/require-hook":`error`,"test/require-to-throw-message":`error`,"test/require-top-level-describe":`error`,"test/warn-todo":`warn`}}]}async function W(){let e=await E(import(`typescript-eslint`)),t=[s],[n,r,i]=e.configs.strict,a=e.configs.stylistic[2],o=O(n,[`rules`,`name`]),c={...r?.rules,...i?.rules,...a?.rules};return[{...o,name:`favorodera/typescript/setup`},{files:t,name:`favorodera/typescript/rules`,rules:{...c,"ts/array-type":[`error`,{default:`generic`,readonly:`generic`}],"ts/consistent-type-imports":`error`,"ts/default-param-last":`error`,"ts/method-signature-style":`error`,"ts/no-import-type-side-effects":`error`,"ts/no-redeclare":`error`}}]}async function G(){let e=await E(import(`eslint-plugin-unicorn`)),t=[o,s,c],n=e.configs.recommended,{rules:r={}}=n;return[{...O(n,[`rules`,`files`,`name`]),name:`favorodera/unicorn/setup`},{files:t,name:`favorodera/unicorn/rules`,rules:{...r,"unicorn/single-line-block-comment-style":[`error`,`single-line`],"unicorn/prefer-query-selector":[`error`,{allowWithVariables:!0}]}}]}async function K(){return[{name:`favorodera/unused-imports/setup`,plugins:{"unused-imports":await E(import(`eslint-plugin-unused-imports`))}},{files:[o,s,c],name:`favorodera/unused-imports/rules`,rules:{"unused-imports/no-unused-imports":`error`,"unused-imports/no-unused-vars":[`error`,{args:`after-used`,argsIgnorePattern:`^_`,ignoreRestSiblings:!0,vars:`all`,varsIgnorePattern:`^_`}]}}]}const q={blocks:{customBlocks:!0,styles:!0,template:!1}},J={sfcBlocks:q};async function Y(e){let n=D(t(e,J).sfcBlocks,q),[i,o,s,l]=await Promise.all([E(import(`eslint-plugin-vue`)),E(import(`vue-eslint-parser`)),E(import(`typescript-eslint`)),E(import(`eslint-plugin-vuejs-accessibility`))]),u=i.configs[`flat/recommended-error`],d=l.configs[`flat/recommended`],[f]=u,p=O(f,[`rules`,`files`,`name`]),m=T(u),[h]=d,g=O(h,[`name`]),_=T(d),v=n===!1?i.processors[`.vue`]:r([i.processors[`.vue`],a(n)]);return[{...p,languageOptions:{globals:{computed:`readonly`,defineEmits:`readonly`,defineExpose:`readonly`,defineProps:`readonly`,onMounted:`readonly`,onUnmounted:`readonly`,reactive:`readonly`,ref:`readonly`,shallowReactive:`readonly`,shallowRef:`readonly`,toRef:`readonly`,toRefs:`readonly`,watch:`readonly`,watchEffect:`readonly`}},name:`favorodera/vue/setup`},{...g,name:`favorodera/vue/a11y/setup`},{files:[c],languageOptions:{parser:o,parserOptions:{extraFileExtensions:[`.vue`],parser:s.parser,sourceType:`module`}},name:`favorodera/vue/rules`,processor:v,rules:{...m,"vue/block-lang":[`error`,{script:{lang:`ts`}}],"vue/block-order":[`error`,{order:[`script`,`template`,`style`]}],"vue/block-tag-newline":[`error`,{multiline:`always`,singleline:`always`}],"vue/comment-directive":[`error`,{reportUnusedDisableDirectives:!0}],"vue/define-macros-order":[`error`,{defineExposeLast:!0,order:[`defineOptions`,`definePage`,`defineSlots`,`defineEmits`,`defineProps`,`defineModel`]}],"vue/define-props-declaration":[`error`,`type-based`],"vue/define-props-destructuring":[`error`,{destructure:`never`}],"vue/next-tick-style":[`error`,`promise`],"vue/no-import-compiler-macros":`error`,"vue/no-negated-v-if-condition":`error`,"vue/no-reserved-component-names":[`error`,{disallowVue3BuiltInComponents:!0,disallowVueBuiltInComponents:!0,htmlElementCaseSensitive:!1}],"vue/no-root-v-if":`error`,"vue/no-template-target-blank":`error`,"vue/no-unused-emit-declarations":`error`,"vue/no-unused-properties":`error`,"vue/no-unused-refs":`error`,"vue/no-use-v-else-with-v-for":`error`,"vue/no-useless-mustaches":`error`,"vue/no-useless-v-bind":`error`,"vue/padding-line-between-blocks":`error`,"vue/padding-line-between-tags":[`error`,[{blankLine:`always`,next:`*:multi-line`,prev:`*:single-line`},{blankLine:`always`,next:`*:single-line`,prev:`*:multi-line`},{blankLine:`always`,next:`*:multi-line`,prev:`*:multi-line`},{blankLine:`never`,next:`*:single-line`,prev:`*:single-line`}]],"vue/prefer-prop-type-boolean-first":`error`,"vue/prefer-separate-static-class":`error`,"vue/prefer-single-event-payload":`error`,"vue/prefer-use-template-ref":`error`,"vue/slot-name-casing":[`error`,`kebab-case`],"vue/v-for-delimiter-style":[`error`,`in`]}},{files:[c],name:`favorodera/vue/a11y/rules`,rules:{..._,"vue-a11y/form-control-has-label":[`error`,{controlComponents:[],labelComponents:[]}],"vue-a11y/label-has-for":[`error`,{allowChildren:!0,components:[],controlComponents:[],required:{some:[`nesting`,`id`]}}],"vue-a11y/no-aria-hidden-on-focusable":`error`,"vue-a11y/no-role-presentation-on-focusable":`error`}}]}async function X(){let[e,t]=await Promise.all([E(import(`eslint-plugin-yml`)),E(import(`yaml-eslint-parser`))]),n=e.configs.standard,[r]=n,i=O(r,[`rules`,`files`,`name`]),a=T(n);return[{...i,name:`favorodera/yaml/setup`},{files:[v],language:`yaml/yaml`,languageOptions:{parser:t},name:`favorodera/yaml/rules`,rules:{...a,"yaml/quotes":[`error`,{avoidEscape:!0,prefer:`single`}],"yaml/require-string-key":`error`}},{files:[y],language:`yaml/yaml`,languageOptions:{parser:t},name:`favorodera/yaml/sort/pnpm-workspace-yaml`,rules:{"yaml/sort-keys":[`error`,{order:`cacheDir.catalogMode.cleanupUnusedCatalogs.dedupeDirectDeps.deployAllFiles.enablePrePostScripts.engineStrict.extendNodePath.hoist.hoistPattern.hoistWorkspacePackages.ignoreCompatibilityDb.ignoreDepScripts.ignoreScripts.ignoreWorkspaceRootCheck.managePackageManagerVersions.minimumReleaseAge.minimumReleaseAgeExclude.modulesDir.nodeLinker.nodeVersion.optimisticRepeatInstall.packageManagerStrict.packageManagerStrictVersion.preferSymlinkedExecutables.preferWorkspacePackages.publicHoistPattern.registrySupportsTimeField.requiredScripts.resolutionMode.savePrefix.scriptShell.shamefullyHoist.shellEmulator.stateDir.supportedArchitectures.symlink.tag.trustPolicy.trustPolicyExclude.updateNotifier.packages.overrides.patchedDependencies.catalog.catalogs.allowedDeprecatedVersions.allowNonAppliedPatches.configDependencies.ignoredBuiltDependencies.ignoredOptionalDependencies.neverBuiltDependencies.onlyBuiltDependencies.onlyBuiltDependenciesFile.packageExtensions.peerDependencyRules`.split(`.`),pathPattern:`^$`},{order:{type:`asc`},pathPattern:`.*`}]}}]}function Z(t={}){let n=[w(t.ignores)],r={imports:k,javascript:A,jsdoc:j,jsonc:M,markdown:P,node:F,perfectionist:L,pnpm:R,stylistic:B,tailwind:H,test:U,typescript:W,unicorn:G,unusedImports:K,vue:Y,yaml:X};for(let[e,i]of Object.entries(r)){let r=t[e],a=D(r??!0,{});a&&n.push(i(a))}let i=new e;return i=i.append(...n).append(...S()).renamePlugins({"@typescript-eslint":`ts`,"better-tailwindcss":`tailwind`,"import-lite":`import`,markdown:`md`,n:`node`,vitest:`test`,"vuejs-accessibility":`vue-a11y`,yml:`yaml`}),i}export{d as codeInMdGlob,T as extractRules,Z as factory,x as ignoresGlob,E as importModule,o as jsGlob,h as json5Glob,m as jsonGlob,g as jsoncGlob,l as mdGlob,u as mdInMdGlob,O as omit,b as packageJsonGlob,y as pnpmWorkspaceGlob,f as scriptsGlob,p as testGlob,_ as tsConfigGlob,s as tsGlob,c as vueGlob,v as yamlGlob};