@ntnyq/eslint-config 2.0.0-beta.9 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,10 +1,16 @@
1
- // src/shared.ts
2
- var GLOB_SRC_EXT = "?([mt])[jt]s?(x)";
3
- var GLOB_SRC = "**/*.?([mt])[jt]s?(x)";
4
- var GLOB_JS = "**/*.?([mt])js";
5
- var GLOB_JSX = "**/*.?([mt])jsx";
6
- var GLOB_TS = "**/*.?([mt])ts";
7
- var GLOB_TSX = "**/*.?([mt])tsx";
1
+ // src/env.ts
2
+ import { isPackageExists } from "local-pkg";
3
+ var hasTypeScript = isPackageExists("typescript");
4
+ var hasVue = isPackageExists("vue") || isPackageExists("nuxt") || isPackageExists("vitepress") || isPackageExists("@slidev/cli");
5
+ var hasUnoCSS = isPackageExists("unocss") || isPackageExists("@unocss/webpack") || isPackageExists("@unocss/nuxt");
6
+
7
+ // src/globs.ts
8
+ var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
9
+ var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
10
+ var GLOB_JS = "**/*.?([cm])js";
11
+ var GLOB_JSX = "**/*.?([cm])jsx";
12
+ var GLOB_TS = "**/*.?([cm])ts";
13
+ var GLOB_TSX = "**/*.?([cm])tsx";
8
14
  var GLOB_STYLE = "**/*.{c,le,sc}ss";
9
15
  var GLOB_CSS = "**/*.css";
10
16
  var GLOB_LESS = "**/*.less";
@@ -13,7 +19,6 @@ var GLOB_JSON = "**/*.json";
13
19
  var GLOB_JSON5 = "**/*.json5";
14
20
  var GLOB_JSONC = "**/*.jsonc";
15
21
  var GLOB_VUE = "**/*.vue";
16
- var GLOB_ASTRO = "**/*.astro";
17
22
  var GLOB_MARKDOWN = "**/*.md";
18
23
  var GLOB_YAML = "**/*.y?(a)ml";
19
24
  var GLOB_HTML = "**/*.htm?(l)";
@@ -29,7 +34,12 @@ var GLOB_ALL_SRC = [
29
34
  ];
30
35
  var GLOB_NODE_MODULES = "**/node_modules/**";
31
36
  var GLOB_DIST = "**/dist/**";
32
- var GLOB_LOCKFILE = ["**/package-lock.json", "**/yarn.lock", "**/pnpm-lock.yaml"];
37
+ var GLOB_LOCKFILE = [
38
+ "**/package-lock.json",
39
+ "**/yarn.lock",
40
+ "**/pnpm-lock.yaml",
41
+ "**/bun.lockb"
42
+ ];
33
43
  var GLOB_EXCLUDE = [
34
44
  GLOB_NODE_MODULES,
35
45
  GLOB_DIST,
@@ -38,27 +48,271 @@ var GLOB_EXCLUDE = [
38
48
  "**/*.min.*",
39
49
  "**/LICENSE*",
40
50
  "**/__snapshots__",
41
- "**/auto-import.d.ts",
51
+ "**/auto-import?(s).d.ts",
42
52
  "**/components.d.ts",
43
- "**/output",
44
53
  "**/coverage",
54
+ "**/fixtures",
55
+ "**/output",
56
+ "**/public",
57
+ "**/static",
45
58
  "**/temp",
46
59
  "**/cache",
47
- "**/fixtures",
48
60
  "**/.vitepress/cache",
61
+ "**/.eslintcache",
62
+ "**/.stylelintcache",
63
+ "**/.vite-inspect",
49
64
  "**/.nuxt",
65
+ "**/.output",
66
+ "**/.tsup",
67
+ "**/.nitro",
50
68
  "**/.vercel",
51
69
  "**/.changeset",
52
70
  "**/.npmrc",
53
- "**/.yarnrc"
71
+ "**/.yarnrc",
72
+ // Force lint
73
+ "!.github",
74
+ "!.vitepress",
75
+ "!.vuepress",
76
+ "!.vscode"
54
77
  ];
55
78
 
56
- // src/configs/js.ts
79
+ // src/presets.ts
80
+ import { defineFlatConfig as defineFlatConfig16 } from "eslint-define-config";
81
+
82
+ // src/configs/ignores.ts
83
+ import { defineFlatConfig } from "eslint-define-config";
84
+ var ignores = defineFlatConfig([
85
+ {
86
+ ignores: GLOB_EXCLUDE
87
+ }
88
+ ]);
89
+
90
+ // src/configs/node.ts
91
+ import { defineFlatConfig as defineFlatConfig2 } from "eslint-define-config";
92
+
93
+ // src/plugins.ts
94
+ import { default as default2 } from "eslint-plugin-n";
95
+ import { default as default3 } from "eslint-plugin-vue";
96
+ import { default as default4 } from "@unocss/eslint-plugin";
97
+ import { default as default5 } from "eslint-plugin-unicorn";
98
+ import { default as default6 } from "eslint-plugin-prettier";
99
+ import { default as default7 } from "eslint-plugin-markdown";
100
+ import { default as default8 } from "eslint-plugin-eslint-comments";
101
+ import { default as default9 } from "eslint-plugin-yml";
102
+ import { default as default10 } from "eslint-plugin-jsonc";
103
+ import { default as default11 } from "eslint-plugin-import-x";
104
+ import { default as default12 } from "eslint-plugin-jsdoc";
105
+ import tseslint from "typescript-eslint";
106
+ import * as parserYaml from "yaml-eslint-parser";
107
+ import * as parserVue from "vue-eslint-parser";
108
+ import * as parserJsonc from "jsonc-eslint-parser";
109
+ // @__NO_SIDE_EFFECTS__
110
+ function interopDefault(m) {
111
+ return m.default || m;
112
+ }
113
+
114
+ // src/configs/node.ts
115
+ var node = defineFlatConfig2([
116
+ {
117
+ plugins: {
118
+ node: default2
119
+ },
120
+ rules: {
121
+ "node/handle-callback-err": ["error", "^(err|error)$"],
122
+ "node/no-deprecated-api": "error",
123
+ "node/no-exports-assign": "error",
124
+ "node/no-new-require": "error",
125
+ "node/no-path-concat": "error",
126
+ "node/prefer-global/buffer": ["error", "never"],
127
+ "node/prefer-global/process": ["error", "never"],
128
+ "node/process-exit-as-throw": "error"
129
+ }
130
+ }
131
+ ]);
132
+
133
+ // src/configs/jsdoc.ts
134
+ import { defineFlatConfig as defineFlatConfig3 } from "eslint-define-config";
135
+ var jsdoc = defineFlatConfig3([
136
+ {
137
+ plugins: {
138
+ jsdoc: default12
139
+ },
140
+ rules: {
141
+ "jsdoc/check-access": "warn",
142
+ "jsdoc/check-param-names": "warn",
143
+ "jsdoc/check-property-names": "warn",
144
+ "jsdoc/check-types": "warn",
145
+ "jsdoc/empty-tags": "warn",
146
+ "jsdoc/implements-on-classes": "warn",
147
+ "jsdoc/no-defaults": "warn",
148
+ "jsdoc/no-multi-asterisks": "warn",
149
+ "jsdoc/require-param-name": "warn",
150
+ "jsdoc/require-property": "warn",
151
+ "jsdoc/require-property-description": "warn",
152
+ "jsdoc/require-property-name": "warn",
153
+ "jsdoc/require-returns-check": "warn",
154
+ "jsdoc/require-returns-description": "warn",
155
+ "jsdoc/require-yields-check": "warn",
156
+ "jsdoc/check-alignment": "warn",
157
+ "jsdoc/multiline-blocks": "warn"
158
+ }
159
+ }
160
+ ]);
161
+
162
+ // src/configs/imports.ts
163
+ import { defineFlatConfig as defineFlatConfig4 } from "eslint-define-config";
164
+ var imports = defineFlatConfig4([
165
+ {
166
+ plugins: {
167
+ import: default11
168
+ },
169
+ settings: {
170
+ "import/resolver": {
171
+ node: { extensions: [".js", ".mjs", ".ts", ".mts", ".d.ts"] }
172
+ }
173
+ },
174
+ rules: {
175
+ "import/no-unresolved": "off",
176
+ "import/no-absolute-path": "off",
177
+ "import/no-named-as-default-member": "off",
178
+ "import/first": "error",
179
+ "import/export": "error",
180
+ "import/no-duplicates": "error",
181
+ "import/no-mutable-exports": "error",
182
+ "import/newline-after-import": "error",
183
+ "import/order": [
184
+ "error",
185
+ {
186
+ groups: [
187
+ "builtin",
188
+ "external",
189
+ "internal",
190
+ "parent",
191
+ "sibling",
192
+ "index",
193
+ "object",
194
+ "type"
195
+ ],
196
+ "newlines-between": "never",
197
+ pathGroups: [{ pattern: "{{@,~}/,#}**", group: "internal" }],
198
+ pathGroupsExcludedImportTypes: ["type"]
199
+ }
200
+ ]
201
+ }
202
+ }
203
+ ]);
204
+
205
+ // src/configs/unicorn.ts
206
+ import { defineFlatConfig as defineFlatConfig5 } from "eslint-define-config";
207
+ var unicorn = defineFlatConfig5([
208
+ {
209
+ plugins: {
210
+ unicorn: default5
211
+ },
212
+ rules: {
213
+ "unicorn/no-unsafe-regex": "off",
214
+ "unicorn/error-message": "error",
215
+ "unicorn/escape-case": "error",
216
+ "unicorn/no-new-buffer": "error",
217
+ "unicorn/number-literal-case": "error",
218
+ "unicorn/prefer-includes": "error",
219
+ "unicorn/prefer-type-error": "error",
220
+ "unicorn/throw-new-error": "error",
221
+ "unicorn/no-unnecessary-await": "error",
222
+ "unicorn/switch-case-braces": ["error", "avoid"],
223
+ "unicorn/no-typeof-undefined": "error",
224
+ "unicorn/prefer-set-size": "error",
225
+ "unicorn/better-regex": "error",
226
+ "unicorn/prefer-regexp-test": "error",
227
+ "unicorn/prefer-top-level-await": "error",
228
+ "unicorn/no-static-only-class": "error",
229
+ "unicorn/no-zero-fractions": "error",
230
+ "unicorn/custom-error-definition": "error",
231
+ "unicorn/prefer-modern-math-apis": "error",
232
+ "unicorn/explicit-length-check": "error",
233
+ "unicorn/new-for-builtins": "error",
234
+ "unicorn/no-console-spaces": "error",
235
+ "unicorn/no-for-loop": "error",
236
+ "unicorn/no-hex-escape": "error",
237
+ "unicorn/no-lonely-if": "error",
238
+ "unicorn/prefer-keyboard-event-key": "error",
239
+ "unicorn/prefer-math-trunc": "error",
240
+ "unicorn/prefer-negative-index": "error",
241
+ "unicorn/prefer-node-protocol": "error",
242
+ "unicorn/prefer-number-properties": "error",
243
+ "unicorn/prefer-optional-catch-binding": "error",
244
+ "unicorn/prefer-prototype-methods": "error",
245
+ "unicorn/prefer-reflect-apply": "error",
246
+ "unicorn/catch-error-name": [
247
+ "error",
248
+ {
249
+ name: "err",
250
+ ignore: ["^_."]
251
+ }
252
+ ],
253
+ "unicorn/prefer-date-now": "error",
254
+ // String
255
+ "unicorn/prefer-string-slice": "error",
256
+ "unicorn/prefer-string-trim-start-end": "error",
257
+ "unicorn/prefer-string-starts-ends-with": "error",
258
+ // DOM
259
+ "unicorn/prefer-add-event-listener": "error",
260
+ "unicorn/no-invalid-remove-event-listener": "error",
261
+ "unicorn/prefer-query-selector": "error",
262
+ "unicorn/prefer-modern-dom-apis": "error",
263
+ "unicorn/prefer-dom-node-append": "error",
264
+ "unicorn/prefer-dom-node-dataset": "error",
265
+ "unicorn/prefer-dom-node-remove": "error",
266
+ "unicorn/prefer-dom-node-text-content": "error",
267
+ // Array
268
+ "unicorn/no-new-array": "error",
269
+ "unicorn/no-instanceof-array": "error",
270
+ "unicorn/no-array-push-push": "error",
271
+ "unicorn/no-array-callback-reference": "error",
272
+ "unicorn/no-array-method-this-argument": "error",
273
+ "unicorn/prefer-array-find": "error",
274
+ "unicorn/prefer-array-some": "error",
275
+ "unicorn/prefer-array-flat-map": "error",
276
+ "unicorn/prefer-array-index-of": "error"
277
+ }
278
+ }
279
+ ]);
280
+
281
+ // src/configs/prettier.ts
282
+ import prettierConfig from "eslint-config-prettier";
283
+ import { defineFlatConfig as defineFlatConfig6 } from "eslint-define-config";
284
+ var prettier = defineFlatConfig6([
285
+ {
286
+ plugins: {
287
+ prettier: default6
288
+ },
289
+ rules: {
290
+ ...prettierConfig.rules,
291
+ ...default6.configs.recommended.rules,
292
+ "prettier/prettier": "warn"
293
+ }
294
+ }
295
+ ]);
296
+
297
+ // src/configs/comments.ts
298
+ import { defineFlatConfig as defineFlatConfig7 } from "eslint-define-config";
299
+ var comments = defineFlatConfig7([
300
+ {
301
+ plugins: {
302
+ "eslint-comments": default8
303
+ },
304
+ rules: {
305
+ ...default8.configs.recommended.rules,
306
+ "eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }]
307
+ }
308
+ }
309
+ ]);
310
+
311
+ // src/configs/javascript.ts
57
312
  import globals from "globals";
58
313
  import jsConfig from "@eslint/js";
59
- import importPlugin from "eslint-plugin-import";
60
- import unicornPlugin from "eslint-plugin-unicorn";
61
- var js = [
314
+ import { defineFlatConfig as defineFlatConfig8 } from "eslint-define-config";
315
+ var javascript = defineFlatConfig8([
62
316
  jsConfig.configs.recommended,
63
317
  {
64
318
  languageOptions: {
@@ -70,7 +324,7 @@ var js = [
70
324
  sourceType: "module"
71
325
  },
72
326
  rules: {
73
- // standard v 17.0.0
327
+ // standard v17.0.0
74
328
  "accessor-pairs": ["error", { setWithoutGet: true, enforceForClassMembers: true }],
75
329
  "array-bracket-spacing": ["error", "never"],
76
330
  "arrow-spacing": ["error", { before: true, after: true }],
@@ -255,7 +509,7 @@ var js = [
255
509
  semi: ["error", "never"],
256
510
  "semi-spacing": ["error", { before: false, after: true }],
257
511
  "space-before-blocks": ["error", "always"],
258
- "space-before-function-paren": ["error", "always"],
512
+ "space-before-function-paren": ["error", "never"],
259
513
  "space-in-parens": ["error", "never"],
260
514
  "space-infix-ops": "error",
261
515
  "space-unary-ops": ["error", { words: true, nonwords: false }],
@@ -419,8 +673,8 @@ var js = [
419
673
  "max-lines-per-function": "off"
420
674
  }
421
675
  }
422
- ];
423
- var jsx = [
676
+ ]);
677
+ var jsx = defineFlatConfig8([
424
678
  {
425
679
  files: ["**/*.jsx"],
426
680
  languageOptions: {
@@ -431,352 +685,118 @@ var jsx = [
431
685
  }
432
686
  }
433
687
  }
434
- ];
435
- var imports = [
436
- {
437
- plugins: {
438
- import: importPlugin
439
- },
440
- settings: {
441
- "import/resolver": {
442
- node: { extensions: [".js", ".mjs", ".ts", ".mts", ".d.ts"] }
688
+ ]);
689
+
690
+ // src/configs/typescript.ts
691
+ import { defineFlatConfig as defineFlatConfig9 } from "eslint-define-config";
692
+ var typescriptCore = tseslint.config({
693
+ extends: [...tseslint.configs.recommended],
694
+ files: [GLOB_TS, GLOB_TSX],
695
+ languageOptions: {
696
+ parser: tseslint.parser,
697
+ parserOptions: {
698
+ sourceType: "module"
699
+ }
700
+ },
701
+ rules: {
702
+ "@typescript-eslint/no-unused-vars": "error",
703
+ "@typescript-eslint/no-redeclare": "error",
704
+ "@typescript-eslint/consistent-type-imports": [
705
+ "error",
706
+ {
707
+ prefer: "type-imports",
708
+ fixStyle: "separate-type-imports",
709
+ disallowTypeAnnotations: false
443
710
  }
444
- },
711
+ ],
712
+ "@typescript-eslint/consistent-type-assertions": [
713
+ "error",
714
+ {
715
+ assertionStyle: "as",
716
+ objectLiteralTypeAssertions: "allow-as-parameter"
717
+ }
718
+ ],
719
+ "@typescript-eslint/prefer-as-const": "warn",
720
+ "@typescript-eslint/ban-types": "off",
721
+ "@typescript-eslint/camelcase": "off",
722
+ "@typescript-eslint/no-namespace": "off",
723
+ "@typescript-eslint/ban-ts-ignore": "off",
724
+ "@typescript-eslint/ban-ts-comment": "off",
725
+ "@typescript-eslint/no-explicit-any": "off",
726
+ "@typescript-eslint/no-empty-function": "off",
727
+ "@typescript-eslint/naming-convention": "off",
728
+ "@typescript-eslint/no-empty-interface": "off",
729
+ "@typescript-eslint/no-non-null-assertion": "off",
730
+ "@typescript-eslint/triple-slash-reference": "off",
731
+ "@typescript-eslint/no-parameter-properties": "off",
732
+ "@typescript-eslint/explicit-member-accessibility": "off",
733
+ "@typescript-eslint/explicit-function-return-type": "off",
734
+ "@typescript-eslint/explicit-module-boundary-types": "off",
735
+ "@typescript-eslint/consistent-indexed-object-style": "off"
736
+ }
737
+ });
738
+ var typescript = defineFlatConfig9([
739
+ ...typescriptCore,
740
+ {
741
+ files: ["**/*.d.ts"],
445
742
  rules: {
446
- "import/no-unresolved": "off",
447
- "import/no-absolute-path": "off",
448
- "import/no-named-as-default-member": "off",
449
- "import/first": "error",
450
- "import/no-duplicates": "error",
451
- "import/no-mutable-exports": "error",
452
- "import/newline-after-import": "error",
453
- "import/order": [
454
- "error",
455
- {
456
- groups: [
457
- "builtin",
458
- "external",
459
- "internal",
460
- "parent",
461
- "sibling",
462
- "index",
463
- "object",
464
- "type"
465
- ],
466
- "newlines-between": "never",
467
- pathGroups: [{ pattern: "@/**", group: "internal" }],
468
- pathGroupsExcludedImportTypes: ["type"]
469
- }
470
- ]
743
+ "import/no-duplicates": "off",
744
+ "import/newline-after-import": "off"
745
+ }
746
+ },
747
+ {
748
+ files: ["**/*.{spec,test}.ts?(x)"],
749
+ rules: {
750
+ "no-unused-expressions": "off",
751
+ "max-lines-per-function": "off"
752
+ }
753
+ },
754
+ {
755
+ files: [GLOB_JS, "**/*.cjs"],
756
+ rules: {
757
+ "@typescript-eslint/no-var-requires": "off"
471
758
  }
472
759
  }
473
- ];
474
- var unicorn = [
760
+ ]);
761
+
762
+ // src/configs/unocss.ts
763
+ import { defineFlatConfig as defineFlatConfig10 } from "eslint-define-config";
764
+ var unocss = defineFlatConfig10([
475
765
  {
476
766
  plugins: {
477
- unicorn: unicornPlugin
767
+ unocss: default4
478
768
  },
479
769
  rules: {
480
- "unicorn/no-unsafe-regex": "off",
481
- "unicorn/error-message": "error",
482
- "unicorn/escape-case": "error",
483
- "unicorn/no-new-buffer": "error",
484
- "unicorn/number-literal-case": "error",
485
- "unicorn/prefer-includes": "error",
486
- "unicorn/prefer-type-error": "error",
487
- "unicorn/throw-new-error": "error",
488
- "unicorn/no-unnecessary-await": "error",
489
- "unicorn/switch-case-braces": ["error", "avoid"],
490
- "unicorn/no-typeof-undefined": "error",
491
- "unicorn/prefer-set-size": "error",
492
- "unicorn/better-regex": "error",
493
- "unicorn/custom-error-definition": "error",
494
- "unicorn/explicit-length-check": "error",
495
- "unicorn/new-for-builtins": "error",
496
- "unicorn/no-console-spaces": "error",
497
- "unicorn/no-for-loop": "error",
498
- "unicorn/no-hex-escape": "error",
499
- "unicorn/no-lonely-if": "error",
500
- "unicorn/prefer-keyboard-event-key": "error",
501
- "unicorn/prefer-math-trunc": "error",
502
- "unicorn/prefer-negative-index": "error",
503
- "unicorn/prefer-node-protocol": "error",
504
- "unicorn/prefer-number-properties": "error",
505
- "unicorn/prefer-optional-catch-binding": "error",
506
- "unicorn/prefer-prototype-methods": "error",
507
- "unicorn/prefer-reflect-apply": "error",
508
- "unicorn/prefer-date-now": "error",
509
- // String
510
- "unicorn/prefer-string-slice": "error",
511
- "unicorn/prefer-string-trim-start-end": "error",
512
- "unicorn/prefer-string-starts-ends-with": "error",
513
- // DOM
514
- "unicorn/prefer-add-event-listener": "error",
515
- "unicorn/no-invalid-remove-event-listener": "error",
516
- "unicorn/prefer-query-selector": "error",
517
- "unicorn/prefer-modern-dom-apis": "error",
518
- "unicorn/prefer-dom-node-append": "error",
519
- "unicorn/prefer-dom-node-dataset": "error",
520
- "unicorn/prefer-dom-node-remove": "error",
521
- "unicorn/prefer-dom-node-text-content": "error",
522
- // Array
523
- "unicorn/no-new-array": "error",
524
- "unicorn/no-instanceof-array": "error",
525
- "unicorn/no-array-push-push": "error",
526
- "unicorn/no-array-callback-reference": "error",
527
- "unicorn/no-array-method-this-argument": "error",
528
- "unicorn/prefer-array-find": "error",
529
- "unicorn/prefer-array-some": "error",
530
- "unicorn/prefer-array-flat-map": "error",
531
- "unicorn/prefer-array-index-of": "error"
770
+ "unocss/order": "error",
771
+ // We don't use this
772
+ "unocss/order-attributify": "off"
532
773
  }
533
774
  }
534
- ];
535
-
536
- // src/configs/ts.ts
537
- import tsParser from "@typescript-eslint/parser";
538
- import tsPlugin from "@typescript-eslint/eslint-plugin";
539
- var ts = [
540
- {
541
- files: [GLOB_TS, GLOB_TSX],
542
- languageOptions: {
543
- // @ts-expect-error 2322
544
- parser: tsParser,
545
- parserOptions: {
546
- sourceType: "module"
547
- }
548
- },
549
- plugins: {
550
- "@typescript-eslint": tsPlugin
551
- },
552
- rules: {
553
- ...tsPlugin.configs["eslint-recommended"].overrides[0].rules,
554
- ...tsPlugin.configs.recommended.rules,
555
- "@typescript-eslint/no-unused-vars": "error",
556
- "@typescript-eslint/no-redeclare": "error",
557
- "@typescript-eslint/consistent-type-imports": [
558
- "error",
559
- {
560
- prefer: "type-imports",
561
- fixStyle: "separate-type-imports",
562
- disallowTypeAnnotations: false
563
- }
564
- ],
565
- "@typescript-eslint/prefer-as-const": "warn",
566
- "@typescript-eslint/ban-types": "off",
567
- "@typescript-eslint/camelcase": "off",
568
- "@typescript-eslint/no-namespace": "off",
569
- "@typescript-eslint/ban-ts-ignore": "off",
570
- "@typescript-eslint/ban-ts-comment": "off",
571
- "@typescript-eslint/no-explicit-any": "off",
572
- "@typescript-eslint/no-empty-function": "off",
573
- "@typescript-eslint/naming-convention": "off",
574
- "@typescript-eslint/no-empty-interface": "off",
575
- "@typescript-eslint/no-non-null-assertion": "off",
576
- "@typescript-eslint/triple-slash-reference": "off",
577
- "@typescript-eslint/no-parameter-properties": "off",
578
- "@typescript-eslint/explicit-member-accessibility": "off",
579
- "@typescript-eslint/explicit-function-return-type": "off",
580
- "@typescript-eslint/explicit-module-boundary-types": "off",
581
- "@typescript-eslint/consistent-indexed-object-style": "off"
582
- }
583
- },
584
- {
585
- files: ["**/*.d.ts"],
586
- rules: {
587
- "import/no-duplicates": "off",
588
- "import/newline-after-import": "off"
589
- }
590
- },
591
- {
592
- files: ["**/*.{spec,test}.ts?(x)"],
593
- rules: {
594
- "no-unused-expressions": "off",
595
- "max-lines-per-function": "off"
596
- }
597
- },
598
- {
599
- files: ["**/*.js", "**/*.cjs"],
600
- rules: {
601
- "@typescript-eslint/no-var-requires": "off"
602
- }
603
- }
604
- ];
605
-
606
- // src/configs/vue.ts
607
- import { getPackageInfoSync } from "local-pkg";
608
- import vuePlugin from "eslint-plugin-vue";
609
- import vueParser from "vue-eslint-parser";
610
- import tsPlugin2 from "@typescript-eslint/eslint-plugin";
611
- function getVueVersion() {
612
- const pkg = getPackageInfoSync("vue", { paths: [process.cwd()] });
613
- if (pkg && typeof pkg.version === "string" && !Number.isNaN(+pkg.version[0])) {
614
- return +pkg.version[0];
615
- }
616
- return 3;
617
- }
618
- var isVue3 = getVueVersion() === 3;
619
- var vueBaseRules = {};
620
- var vue2Rules = {
621
- ...vueBaseRules
622
- };
623
- var vue3Rules = {
624
- ...vueBaseRules
625
- };
626
- var vue = [
627
- {
628
- files: [GLOB_VUE],
629
- plugins: {
630
- vue: vuePlugin,
631
- "@typescript-eslint": tsPlugin2
632
- },
633
- languageOptions: {
634
- // @ts-expect-error 2322
635
- parser: vueParser,
636
- parserOptions: {
637
- parser: "@typescript-eslint/parser",
638
- sourceType: "module",
639
- extraFileExtensions: [".vue"],
640
- ecmaFeatures: {
641
- jsx: true
642
- }
643
- }
644
- },
645
- processor: vuePlugin.processors[".vue"],
646
- rules: {
647
- // @ts-expect-error 2339
648
- ...ts[0].rules
649
- }
650
- },
651
- {
652
- plugins: {
653
- vue: vuePlugin
654
- },
655
- rules: isVue3 ? vue3Rules : vue2Rules
656
- }
657
- ];
775
+ ]);
658
776
 
659
777
  // src/configs/yml.ts
660
- import ymlPlugin, { configs } from "eslint-plugin-yml";
661
- import ymlParser from "yaml-eslint-parser";
662
- var yml = [
778
+ import { defineFlatConfig as defineFlatConfig11 } from "eslint-define-config";
779
+ var yml = defineFlatConfig11([
663
780
  {
664
781
  files: [GLOB_YAML],
665
782
  languageOptions: {
666
- // @ts-expect-error 2322
667
- parser: ymlParser
668
- },
669
- plugins: {
670
- yml: ymlPlugin
671
- },
672
- // @ts-expect-error 2322
673
- rules: {
674
- ...configs.standard.rules,
675
- ...configs.prettier.rules,
676
- "yml/no-empty-mapping-value": "off"
677
- }
678
- }
679
- ];
680
-
681
- // src/configs/react.ts
682
- import reactPlugin from "eslint-plugin-react";
683
- import reactHooksPlugin from "eslint-plugin-react-hooks";
684
- var react = [
685
- {
686
- files: [GLOB_JSX, GLOB_TSX],
687
- plugins: {
688
- react: reactPlugin,
689
- reactHooks: reactHooksPlugin
690
- },
691
- settings: {
692
- react: {
693
- version: "18.0"
694
- }
695
- },
696
- languageOptions: {
697
- parserOptions: {
698
- ecmaFeatures: {
699
- jsx: true
700
- }
701
- }
783
+ parser: parserYaml
702
784
  },
703
- rules: {
704
- ...reactPlugin.configs.recommended.rules,
705
- ...reactHooksPlugin.configs.recommended.rules,
706
- "jsx-quotes": ["error", "prefer-double"],
707
- "react/react-in-jsx-scope": "off"
708
- }
709
- }
710
- ];
711
-
712
- // src/configs/astro.ts
713
- import astroPlugin, { configs as configs2 } from "eslint-plugin-astro";
714
- import astroParser from "astro-eslint-parser";
715
- var astro = [
716
- {
717
- files: [GLOB_ASTRO],
718
785
  plugins: {
719
- astro: astroPlugin
786
+ yml: default9
720
787
  },
721
- languageOptions: {
722
- parser: astroParser,
723
- parserOptions: {
724
- parser: "@typescript-eslint/parser",
725
- extraFileExtensions: [".astro"]
726
- }
727
- },
728
- // @ts-expect-error 2322
729
788
  rules: {
730
- ...configs2.recommended.rules
789
+ ...default9.configs.standard.rules,
790
+ ...default9.configs.prettier.rules,
791
+ "yml/no-empty-mapping-value": "off",
792
+ "yml/quotes": ["error", { avoidEscape: false, prefer: "single" }]
731
793
  }
732
794
  }
733
- ];
795
+ ]);
734
796
 
735
- // src/configs/jsonc.ts
736
- import jsoncPlugin, { configs as configs3 } from "eslint-plugin-jsonc";
737
- import jsoncParser from "jsonc-eslint-parser";
738
- var jsonc = [
739
- {
740
- files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC, "**/*rc"],
741
- plugins: {
742
- jsonc: jsoncPlugin
743
- },
744
- languageOptions: {
745
- parser: jsoncParser
746
- },
747
- // @ts-expect-error 2322
748
- rules: {
749
- ...configs3["recommended-with-jsonc"].rules,
750
- "jsonc/array-bracket-spacing": ["error", "never"],
751
- "jsonc/comma-dangle": ["error", "never"],
752
- "jsonc/comma-style": ["error", "last"],
753
- "jsonc/indent": ["error", 2],
754
- "jsonc/key-spacing": [
755
- "error",
756
- {
757
- beforeColon: false,
758
- afterColon: true
759
- }
760
- ],
761
- "jsonc/no-octal-escape": "error",
762
- "jsonc/object-curly-newline": [
763
- "error",
764
- {
765
- multiline: true,
766
- consistent: true
767
- }
768
- ],
769
- "jsonc/object-curly-spacing": ["error", "always"],
770
- "jsonc/object-property-newline": [
771
- "error",
772
- {
773
- allowMultiplePropertiesPerLine: true
774
- }
775
- ]
776
- }
777
- }
778
- ];
779
- var pkgOrder = [
797
+ // src/configs/sort.ts
798
+ import { defineFlatConfig as defineFlatConfig12 } from "eslint-define-config";
799
+ var sortPackageJson = defineFlatConfig12([
780
800
  {
781
801
  files: ["**/package.json"],
782
802
  rules: {
@@ -832,148 +852,543 @@ var pkgOrder = [
832
852
  ]
833
853
  },
834
854
  {
835
- pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies$",
855
+ pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$",
836
856
  order: { type: "asc" }
837
857
  },
858
+ {
859
+ order: { type: "asc" },
860
+ pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$"
861
+ },
838
862
  {
839
863
  pathPattern: "^exports.*$",
840
- order: ["types", "require", "import"]
864
+ order: ["types", "import", "require", "default"]
841
865
  },
842
866
  {
843
867
  pathPattern: "^scripts$",
844
868
  order: { type: "asc" }
869
+ },
870
+ {
871
+ order: [
872
+ // client hooks only
873
+ "pre-commit",
874
+ "prepare-commit-msg",
875
+ "commit-msg",
876
+ "post-commit",
877
+ "pre-rebase",
878
+ "post-rewrite",
879
+ "post-checkout",
880
+ "post-merge",
881
+ "pre-push",
882
+ "pre-auto-gc"
883
+ ],
884
+ pathPattern: "^(?:gitHooks|husky|simple-git-hooks)$"
885
+ }
886
+ ],
887
+ "jsonc/sort-array-values": [
888
+ "error",
889
+ {
890
+ pathPattern: "^files$",
891
+ order: { type: "asc" }
845
892
  }
846
893
  ]
847
894
  }
848
895
  }
849
- ];
896
+ ]);
897
+ var sortTsConfig = defineFlatConfig12([
898
+ {
899
+ files: ["**/tsconfig.json", "**/tsconfig.*.json"],
900
+ rules: {
901
+ "jsonc/sort-keys": [
902
+ "error",
903
+ {
904
+ order: ["extends", "compilerOptions", "references", "files", "include", "exclude"],
905
+ pathPattern: "^$"
906
+ },
907
+ {
908
+ order: [
909
+ /* Projects */
910
+ "incremental",
911
+ "composite",
912
+ "tsBuildInfoFile",
913
+ "disableSourceOfProjectReferenceRedirect",
914
+ "disableSolutionSearching",
915
+ "disableReferencedProjectLoad",
916
+ /* Language and Environment */
917
+ "target",
918
+ "lib",
919
+ "jsx",
920
+ "experimentalDecorators",
921
+ "emitDecoratorMetadata",
922
+ "jsxFactory",
923
+ "jsxFragmentFactory",
924
+ "jsxImportSource",
925
+ "reactNamespace",
926
+ "noLib",
927
+ "useDefineForClassFields",
928
+ "moduleDetection",
929
+ /* Modules */
930
+ "module",
931
+ "rootDir",
932
+ "moduleResolution",
933
+ "baseUrl",
934
+ "paths",
935
+ "rootDirs",
936
+ "typeRoots",
937
+ "types",
938
+ "allowUmdGlobalAccess",
939
+ "moduleSuffixes",
940
+ "allowImportingTsExtensions",
941
+ "resolvePackageJsonExports",
942
+ "resolvePackageJsonImports",
943
+ "customConditions",
944
+ "resolveJsonModule",
945
+ "allowArbitraryExtensions",
946
+ "noResolve",
947
+ /* JavaScript Support */
948
+ "allowJs",
949
+ "checkJs",
950
+ "maxNodeModuleJsDepth",
951
+ /* Emit */
952
+ "declaration",
953
+ "declarationMap",
954
+ "emitDeclarationOnly",
955
+ "sourceMap",
956
+ "inlineSourceMap",
957
+ "outFile",
958
+ "outDir",
959
+ "removeComments",
960
+ "noEmit",
961
+ "importHelpers",
962
+ "importsNotUsedAsValues",
963
+ "downlevelIteration",
964
+ "sourceRoot",
965
+ "mapRoot",
966
+ "inlineSources",
967
+ "emitBOM",
968
+ "newLine",
969
+ "stripInternal",
970
+ "noEmitHelpers",
971
+ "noEmitOnError",
972
+ "preserveConstEnums",
973
+ "declarationDir",
974
+ "preserveValueImports",
975
+ /* Interop Constraints */
976
+ "isolatedModules",
977
+ "verbatimModuleSyntax",
978
+ "allowSyntheticDefaultImports",
979
+ "esModuleInterop",
980
+ "preserveSymlinks",
981
+ "forceConsistentCasingInFileNames",
982
+ /* Type Checking */
983
+ "strict",
984
+ "strictBindCallApply",
985
+ "strictFunctionTypes",
986
+ "strictNullChecks",
987
+ "strictPropertyInitialization",
988
+ "allowUnreachableCode",
989
+ "allowUnusedLabels",
990
+ "alwaysStrict",
991
+ "exactOptionalPropertyTypes",
992
+ "noFallthroughCasesInSwitch",
993
+ "noImplicitAny",
994
+ "noImplicitOverride",
995
+ "noImplicitReturns",
996
+ "noImplicitThis",
997
+ "noPropertyAccessFromIndexSignature",
998
+ "noUncheckedIndexedAccess",
999
+ "noUnusedLocals",
1000
+ "noUnusedParameters",
1001
+ "useUnknownInCatchVariables",
1002
+ /* Completeness */
1003
+ "skipDefaultLibCheck",
1004
+ "skipLibCheck"
1005
+ ],
1006
+ pathPattern: "^compilerOptions$"
1007
+ }
1008
+ ]
1009
+ }
1010
+ }
1011
+ ]);
850
1012
 
851
- // src/configs/prettier.ts
852
- import prettierPlugin from "eslint-plugin-prettier";
853
- import prettierConfig from "eslint-config-prettier";
854
- var prettier = [
1013
+ // src/configs/jsonc.ts
1014
+ import { defineFlatConfig as defineFlatConfig13 } from "eslint-define-config";
1015
+ var jsonc = defineFlatConfig13([
855
1016
  {
1017
+ files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC, "**/*rc"],
856
1018
  plugins: {
857
- prettier: prettierPlugin
1019
+ jsonc: default10
1020
+ },
1021
+ languageOptions: {
1022
+ parser: parserJsonc
858
1023
  },
859
1024
  rules: {
860
- ...prettierConfig.rules,
861
- ...prettierPlugin.configs.recommended.rules,
862
- "prettier/prettier": "warn"
1025
+ ...default10.configs["recommended-with-jsonc"].rules,
1026
+ "jsonc/array-bracket-spacing": ["error", "never"],
1027
+ "jsonc/comma-dangle": ["error", "never"],
1028
+ "jsonc/comma-style": ["error", "last"],
1029
+ "jsonc/indent": ["error", 2],
1030
+ "jsonc/key-spacing": [
1031
+ "error",
1032
+ {
1033
+ beforeColon: false,
1034
+ afterColon: true
1035
+ }
1036
+ ],
1037
+ "jsonc/no-octal-escape": "error",
1038
+ "jsonc/object-curly-newline": [
1039
+ "error",
1040
+ {
1041
+ multiline: true,
1042
+ consistent: true
1043
+ }
1044
+ ],
1045
+ "jsonc/object-curly-spacing": ["error", "always"],
1046
+ "jsonc/object-property-newline": [
1047
+ "error",
1048
+ {
1049
+ allowMultiplePropertiesPerLine: true
1050
+ }
1051
+ ]
863
1052
  }
864
1053
  }
865
- ];
1054
+ ]);
866
1055
 
867
1056
  // src/configs/markdown.ts
868
- import markdownPlugin from "eslint-plugin-markdown";
869
- import tsPlugin3 from "@typescript-eslint/eslint-plugin";
870
- var markdown = [
871
- {
872
- files: [GLOB_MARKDOWN],
873
- plugins: {
874
- markdown: markdownPlugin
875
- },
876
- processor: "markdown/markdown"
877
- },
1057
+ import { defineFlatConfig as defineFlatConfig14 } from "eslint-define-config";
1058
+ var markdown = defineFlatConfig14([
1059
+ ...default7.configs.recommended,
878
1060
  {
879
1061
  files: [`${GLOB_MARKDOWN}/${GLOB_SRC}`, `${GLOB_MARKDOWN}/${GLOB_VUE}`],
880
- languageOptions: {
881
- parserOptions: {
882
- ecmaFeatures: {
883
- impliedStrict: true
884
- }
885
- }
886
- },
887
- plugins: {
888
- "@typescript-eslint": tsPlugin3
889
- },
890
1062
  rules: {
891
- ...markdownPlugin.configs.recommended.overrides[1].rules,
892
1063
  "no-undef": "off",
893
1064
  "no-alert": "off",
894
1065
  "no-console": "off",
895
1066
  "no-unused-vars": "off",
896
1067
  "no-unused-expressions": "off",
897
1068
  "no-restricted-imports": "off",
1069
+ "node/prefer-global/buffer": "off",
1070
+ "node/prefer-global/process": "off",
898
1071
  "import/no-unresolved": "off",
1072
+ "unused-imports/no-unused-imports": "off",
1073
+ "unused-imports/no-unused-vars": "off",
899
1074
  "@typescript-eslint/comma-dangle": "off",
900
1075
  "@typescript-eslint/no-redeclare": "off",
1076
+ "@typescript-eslint/no-namespace": "off",
901
1077
  "@typescript-eslint/no-unused-vars": "off",
902
1078
  "@typescript-eslint/no-var-requires": "off",
903
- "@typescript-eslint/no-use-before-define": "off",
904
- "unused-imports/no-unused-imports": "off",
905
- "unused-imports/no-unused-vars": "off"
1079
+ "@typescript-eslint/no-extraneous-class": "off",
1080
+ "@typescript-eslint/no-use-before-define": "off"
906
1081
  }
907
1082
  }
908
- ];
1083
+ ]);
909
1084
 
910
- // src/configs/eslint-comments.ts
911
- import commentsPlugin from "eslint-plugin-eslint-comments";
912
- var eslintComments = [
1085
+ // src/configs/vue.ts
1086
+ import process from "node:process";
1087
+ import { getPackageInfoSync } from "local-pkg";
1088
+ import { defineFlatConfig as defineFlatConfig15 } from "eslint-define-config";
1089
+ function getVueVersion() {
1090
+ const pkg = getPackageInfoSync("vue", { paths: [process.cwd()] });
1091
+ if (pkg && typeof pkg.version === "string" && !Number.isNaN(+pkg.version[0])) {
1092
+ return +pkg.version[0];
1093
+ }
1094
+ return 3;
1095
+ }
1096
+ var isVue3 = getVueVersion() === 3;
1097
+ var vue2Rules = {
1098
+ ...default3.configs.base.rules,
1099
+ ...default3.configs.essential.rules,
1100
+ ...default3.configs["strongly-recommended"].rules,
1101
+ ...default3.configs.recommended.rules
1102
+ };
1103
+ var vue3Rules = {
1104
+ ...default3.configs.base.rules,
1105
+ ...default3.configs["vue3-essential"].rules,
1106
+ ...default3.configs["vue3-strongly-recommended"].rules,
1107
+ ...default3.configs["vue3-recommended"].rules
1108
+ };
1109
+ var vue = defineFlatConfig15([
1110
+ ...tseslint.config({
1111
+ files: [GLOB_VUE],
1112
+ extends: typescriptCore
1113
+ }),
913
1114
  {
1115
+ files: [GLOB_VUE],
914
1116
  plugins: {
915
- "eslint-comments": commentsPlugin
1117
+ vue: default3,
1118
+ "@typescript-eslint": tseslint.plugin
1119
+ },
1120
+ languageOptions: {
1121
+ parser: parserVue,
1122
+ parserOptions: {
1123
+ parser: "@typescript-eslint/parser",
1124
+ sourceType: "module",
1125
+ extraFileExtensions: [".vue"],
1126
+ ecmaFeatures: {
1127
+ jsx: true
1128
+ }
1129
+ }
916
1130
  },
1131
+ processor: default3.processors[".vue"],
917
1132
  rules: {
918
- ...commentsPlugin.configs.recommended.rules,
919
- "eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }]
1133
+ ...isVue3 ? vue3Rules : vue2Rules,
1134
+ // OFF
1135
+ "vue/no-v-html": "off",
1136
+ "vue/require-prop-types": "off",
1137
+ "vue/require-default-prop": "off",
1138
+ "vue/multi-word-component-names": "off",
1139
+ "vue/no-setup-props-reactivity-loss": "off",
1140
+ "vue/html-self-closing": [
1141
+ "error",
1142
+ {
1143
+ html: {
1144
+ void: "always",
1145
+ normal: "always",
1146
+ component: "always"
1147
+ },
1148
+ svg: "always",
1149
+ math: "always"
1150
+ }
1151
+ ],
1152
+ "vue/block-tag-newline": [
1153
+ "error",
1154
+ {
1155
+ singleline: "always",
1156
+ multiline: "always"
1157
+ }
1158
+ ],
1159
+ "vue/component-name-in-template-casing": [
1160
+ "error",
1161
+ "PascalCase",
1162
+ {
1163
+ // Force auto-import components to be PascalCase
1164
+ registeredComponentsOnly: false,
1165
+ ignores: ["slot", "component"]
1166
+ }
1167
+ ],
1168
+ "vue/component-options-name-casing": ["error", "PascalCase"],
1169
+ "vue/custom-event-name-casing": ["error", "camelCase"],
1170
+ "vue/define-macros-order": [
1171
+ "error",
1172
+ {
1173
+ order: ["defineProps", "defineEmits", "defineOptions", "defineSlots"]
1174
+ }
1175
+ ],
1176
+ "vue/html-comment-content-spacing": [
1177
+ "error",
1178
+ "always",
1179
+ {
1180
+ exceptions: ["-"]
1181
+ }
1182
+ ],
1183
+ "vue/array-bracket-spacing": ["error", "never"],
1184
+ "vue/arrow-spacing": ["error", { before: true, after: true }],
1185
+ "vue/block-spacing": ["error", "always"],
1186
+ "vue/brace-style": ["error", "stroustrup", { allowSingleLine: true }],
1187
+ "vue/comma-dangle": ["error", "always-multiline"],
1188
+ "vue/comma-spacing": ["error", { before: false, after: true }],
1189
+ "vue/comma-style": ["error", "last"],
1190
+ "vue/dot-location": ["error", "property"],
1191
+ "vue/dot-notation": ["error", { allowKeywords: true }],
1192
+ "vue/eqeqeq": ["error", "smart"],
1193
+ "vue/key-spacing": ["error", { beforeColon: false, afterColon: true }],
1194
+ "vue/keyword-spacing": ["error", { before: true, after: true }],
1195
+ "vue/no-empty-pattern": "error",
1196
+ "vue/no-loss-of-precision": "error",
1197
+ "vue/no-irregular-whitespace": "error",
1198
+ "vue/no-use-v-else-with-v-for": "error",
1199
+ "vue/require-typed-object-prop": "error",
1200
+ "vue/no-extra-parens": ["error", "functions"],
1201
+ "vue/no-restricted-syntax": [
1202
+ "error",
1203
+ "DebuggerStatement",
1204
+ "LabeledStatement",
1205
+ "WithStatement"
1206
+ ],
1207
+ "vue/no-sparse-arrays": "error",
1208
+ "vue/no-deprecated-model-definition": [
1209
+ "error",
1210
+ {
1211
+ allowVue3Compat: true
1212
+ }
1213
+ ],
1214
+ "vue/object-curly-newline": [
1215
+ "error",
1216
+ {
1217
+ multiline: true,
1218
+ consistent: true
1219
+ }
1220
+ ],
1221
+ "vue/no-static-inline-styles": [
1222
+ "error",
1223
+ {
1224
+ allowBinding: true
1225
+ }
1226
+ ],
1227
+ "vue/object-curly-spacing": ["error", "always"],
1228
+ "vue/object-property-newline": [
1229
+ "error",
1230
+ {
1231
+ allowMultiplePropertiesPerLine: true
1232
+ }
1233
+ ],
1234
+ "vue/object-shorthand": [
1235
+ "error",
1236
+ "always",
1237
+ {
1238
+ ignoreConstructors: false,
1239
+ avoidQuotes: true
1240
+ }
1241
+ ],
1242
+ "vue/operator-linebreak": ["error", "before"],
1243
+ "vue/prefer-template": "error",
1244
+ "vue/prop-name-casing": ["error", "camelCase"],
1245
+ "vue/quote-props": ["error", "consistent-as-needed"],
1246
+ "vue/space-in-parens": ["error", "never"],
1247
+ "vue/space-infix-ops": "error",
1248
+ "vue/space-unary-ops": [
1249
+ "error",
1250
+ {
1251
+ words: true,
1252
+ nonwords: false
1253
+ }
1254
+ ],
1255
+ "vue/template-curly-spacing": "error",
1256
+ "vue/block-order": [
1257
+ "error",
1258
+ {
1259
+ order: ["script", "template", "style"]
1260
+ }
1261
+ ],
1262
+ "vue/attributes-order": [
1263
+ "error",
1264
+ {
1265
+ order: [
1266
+ "EVENTS",
1267
+ // `@click="functionCall"`, `v-on="event"`
1268
+ "TWO_WAY_BINDING",
1269
+ // `v-model`
1270
+ "OTHER_DIRECTIVES",
1271
+ // `v-custom-directive`
1272
+ "LIST_RENDERING",
1273
+ // `v-for item in items`
1274
+ "CONDITIONALS",
1275
+ // `v-if`, `v-show`, `v-cloak`
1276
+ "CONTENT",
1277
+ // `v-text`, `v-html`
1278
+ "SLOT",
1279
+ // `v-slot`, `slot`
1280
+ "UNIQUE",
1281
+ // `ref`, `key`
1282
+ "DEFINITION",
1283
+ // `is`, `v-is`
1284
+ "ATTR_DYNAMIC",
1285
+ // `v-bind:prop="foo"`, `:prop="foo"`
1286
+ // `OTHER_ATTR`, // `custom-prop="foo"`, `:prop="foo"`, `disabled`
1287
+ "RENDER_MODIFIERS",
1288
+ // `v-once`, `v-pre`
1289
+ "GLOBAL",
1290
+ // `id`
1291
+ "ATTR_STATIC",
1292
+ // `prop="foo", `static attributes
1293
+ "ATTR_SHORTHAND_BOOL"
1294
+ // `disabled`, prop shorthand
1295
+ ],
1296
+ alphabetical: false
1297
+ }
1298
+ ],
1299
+ "vue/order-in-components": [
1300
+ "error",
1301
+ {
1302
+ order: [
1303
+ "el",
1304
+ "name",
1305
+ "key",
1306
+ "parent",
1307
+ "functional",
1308
+ ["provide", "inject"],
1309
+ ["delimiters", "comments"],
1310
+ ["components", "directives", "filters"],
1311
+ "extends",
1312
+ "mixins",
1313
+ "layout",
1314
+ "middleware",
1315
+ "validate",
1316
+ "scrollToTop",
1317
+ "transition",
1318
+ "loading",
1319
+ "inheritAttrs",
1320
+ "model",
1321
+ ["props", "propsData"],
1322
+ "emits",
1323
+ "setup",
1324
+ "asyncData",
1325
+ "computed",
1326
+ "data",
1327
+ "fetch",
1328
+ "head",
1329
+ "methods",
1330
+ ["template", "render"],
1331
+ "watch",
1332
+ "watchQuery",
1333
+ "LIFECYCLE_HOOKS",
1334
+ "renderError",
1335
+ "ROUTER_GUARDS"
1336
+ ]
1337
+ }
1338
+ ],
1339
+ "vue/max-attributes-per-line": [
1340
+ "error",
1341
+ {
1342
+ singleline: 1,
1343
+ multiline: 1
1344
+ }
1345
+ ]
920
1346
  }
921
1347
  }
922
- ];
1348
+ ]);
923
1349
 
924
1350
  // src/presets.ts
925
- var GLOBAL_IGNORE = { ignores: GLOB_EXCLUDE };
926
- var basic = [
927
- GLOBAL_IGNORE,
928
- ...js,
1351
+ var presetJavaScript = [
1352
+ ...ignores,
1353
+ ...jsdoc,
929
1354
  ...jsx,
930
- ...ts,
931
- ...yml,
1355
+ ...node,
932
1356
  ...imports,
933
1357
  ...unicorn,
934
- ...jsonc,
935
- ...pkgOrder,
936
- ...eslintComments
937
- ];
938
- var all = [
939
- ...basic,
940
- ...vue,
941
- ...react,
942
- ...astro,
943
- ...prettier,
944
- ...markdown
1358
+ ...comments,
1359
+ ...javascript
945
1360
  ];
1361
+ var presetBasic = [...presetJavaScript, ...typescript];
1362
+ var presetJsonc = [...jsonc, ...sortPackageJson, ...sortTsConfig];
1363
+ var presetLanguageExtensions = [...presetJsonc, ...yml, ...markdown];
1364
+ var presetCommon = [...presetBasic, ...presetLanguageExtensions, ...prettier];
1365
+ var presetAll = [...presetCommon, ...vue, ...unocss];
946
1366
  function ntnyq(config = [], {
947
- vue: enableVue = false,
948
- react: enableReact = false,
949
- astro: enableAstro = false,
950
- prettier: enablePrettier = false,
951
- markdown: enableMarkdown = false
1367
+ vue: enableVue = hasVue,
1368
+ unocss: enableUnoCSS = hasUnoCSS,
1369
+ prettier: enablePrettier = true,
1370
+ markdown: enableMarkdown = true
952
1371
  } = {}) {
953
- const configs4 = [...basic];
1372
+ const configs = defineFlatConfig16([...presetBasic, ...yml, ...presetJsonc]);
954
1373
  if (enableVue) {
955
- configs4.push(...vue);
1374
+ configs.push(...vue);
956
1375
  }
957
- if (enableReact) {
958
- configs4.push(...react);
1376
+ if (enableUnoCSS) {
1377
+ configs.push(...unocss);
959
1378
  }
960
- if (enableAstro) {
961
- configs4.push(...astro);
1379
+ if (enablePrettier) {
1380
+ configs.push(...prettier);
962
1381
  }
963
1382
  if (enableMarkdown) {
964
- configs4.push(...markdown);
965
- }
966
- if (enablePrettier) {
967
- configs4.push(...prettier);
1383
+ configs.push(...markdown);
968
1384
  }
969
1385
  if (Object.keys(config).length > 0) {
970
- configs4.push(...Array.isArray(config) ? config : [config]);
1386
+ configs.push(...Array.isArray(config) ? config : [config]);
971
1387
  }
972
- return configs4;
1388
+ return configs;
973
1389
  }
974
1390
  export {
975
1391
  GLOB_ALL_SRC,
976
- GLOB_ASTRO,
977
1392
  GLOB_CSS,
978
1393
  GLOB_DIST,
979
1394
  GLOB_EXCLUDE,
@@ -995,28 +1410,49 @@ export {
995
1410
  GLOB_TSX,
996
1411
  GLOB_VUE,
997
1412
  GLOB_YAML,
998
- all,
999
- astro,
1000
- basic,
1001
- eslintComments,
1413
+ comments,
1002
1414
  getVueVersion,
1415
+ hasTypeScript,
1416
+ hasUnoCSS,
1417
+ hasVue,
1418
+ ignores,
1003
1419
  imports,
1004
- js,
1420
+ interopDefault,
1421
+ javascript,
1422
+ jsdoc,
1005
1423
  jsonc,
1006
1424
  jsx,
1007
1425
  markdown,
1426
+ node,
1008
1427
  ntnyq,
1009
- pkgOrder,
1428
+ parserJsonc,
1429
+ parserVue,
1430
+ parserYaml,
1431
+ default8 as pluginComments,
1432
+ default11 as pluginImport,
1433
+ default12 as pluginJsdoc,
1434
+ default10 as pluginJsonc,
1435
+ default7 as pluginMarkdown,
1436
+ default2 as pluginNode,
1437
+ default6 as pluginPrettier,
1438
+ default5 as pluginUnicorn,
1439
+ default4 as pluginUnoCSS,
1440
+ default3 as pluginVue,
1441
+ default9 as pluginYaml,
1442
+ presetAll,
1443
+ presetBasic,
1444
+ presetCommon,
1445
+ presetJavaScript,
1446
+ presetJsonc,
1447
+ presetLanguageExtensions,
1010
1448
  prettier,
1011
- react,
1012
- reactHooksPlugin,
1013
- reactPlugin,
1014
- ts,
1015
- tsParser,
1016
- tsPlugin,
1449
+ sortPackageJson,
1450
+ sortTsConfig,
1451
+ tseslint,
1452
+ typescript,
1453
+ typescriptCore,
1017
1454
  unicorn,
1455
+ unocss,
1018
1456
  vue,
1019
- vueParser,
1020
- vuePlugin,
1021
1457
  yml
1022
1458
  };