@ntnyq/eslint-config 2.0.0-beta.8 → 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,9 +1,16 @@
1
- // src/shared.ts
2
- var GLOB_SRC = "**/*.?([mt])[jt]s?(x)";
3
- var GLOB_JS = "**/*.?([mt])js";
4
- var GLOB_JSX = "**/*.?([mt])jsx";
5
- var GLOB_TS = "**/*.?([mt])ts";
6
- 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";
7
14
  var GLOB_STYLE = "**/*.{c,le,sc}ss";
8
15
  var GLOB_CSS = "**/*.css";
9
16
  var GLOB_LESS = "**/*.less";
@@ -12,7 +19,6 @@ var GLOB_JSON = "**/*.json";
12
19
  var GLOB_JSON5 = "**/*.json5";
13
20
  var GLOB_JSONC = "**/*.jsonc";
14
21
  var GLOB_VUE = "**/*.vue";
15
- var GLOB_ASTRO = "**/*.astro";
16
22
  var GLOB_MARKDOWN = "**/*.md";
17
23
  var GLOB_YAML = "**/*.y?(a)ml";
18
24
  var GLOB_HTML = "**/*.htm?(l)";
@@ -28,7 +34,12 @@ var GLOB_ALL_SRC = [
28
34
  ];
29
35
  var GLOB_NODE_MODULES = "**/node_modules/**";
30
36
  var GLOB_DIST = "**/dist/**";
31
- 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
+ ];
32
43
  var GLOB_EXCLUDE = [
33
44
  GLOB_NODE_MODULES,
34
45
  GLOB_DIST,
@@ -36,28 +47,272 @@ var GLOB_EXCLUDE = [
36
47
  "**/CHANGELOG*.md",
37
48
  "**/*.min.*",
38
49
  "**/LICENSE*",
39
- "**/output",
50
+ "**/__snapshots__",
51
+ "**/auto-import?(s).d.ts",
52
+ "**/components.d.ts",
40
53
  "**/coverage",
54
+ "**/fixtures",
55
+ "**/output",
56
+ "**/public",
57
+ "**/static",
41
58
  "**/temp",
42
59
  "**/cache",
43
- "**/fixtures",
44
60
  "**/.vitepress/cache",
61
+ "**/.eslintcache",
62
+ "**/.stylelintcache",
63
+ "**/.vite-inspect",
45
64
  "**/.nuxt",
65
+ "**/.output",
66
+ "**/.tsup",
67
+ "**/.nitro",
46
68
  "**/.vercel",
47
69
  "**/.changeset",
48
- "**/__snapshots__",
49
- "**/auto-import.d.ts",
50
- "**/components.d.ts",
51
70
  "**/.npmrc",
52
- "**/.yarnrc"
71
+ "**/.yarnrc",
72
+ // Force lint
73
+ "!.github",
74
+ "!.vitepress",
75
+ "!.vuepress",
76
+ "!.vscode"
53
77
  ];
54
78
 
55
- // 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
56
312
  import globals from "globals";
57
313
  import jsConfig from "@eslint/js";
58
- import importPlugin from "eslint-plugin-import";
59
- import unicornPlugin from "eslint-plugin-unicorn";
60
- var js = [
314
+ import { defineFlatConfig as defineFlatConfig8 } from "eslint-define-config";
315
+ var javascript = defineFlatConfig8([
61
316
  jsConfig.configs.recommended,
62
317
  {
63
318
  languageOptions: {
@@ -69,7 +324,7 @@ var js = [
69
324
  sourceType: "module"
70
325
  },
71
326
  rules: {
72
- // standard v 17.0.0
327
+ // standard v17.0.0
73
328
  "accessor-pairs": ["error", { setWithoutGet: true, enforceForClassMembers: true }],
74
329
  "array-bracket-spacing": ["error", "never"],
75
330
  "arrow-spacing": ["error", { before: true, after: true }],
@@ -254,7 +509,7 @@ var js = [
254
509
  semi: ["error", "never"],
255
510
  "semi-spacing": ["error", { before: false, after: true }],
256
511
  "space-before-blocks": ["error", "always"],
257
- "space-before-function-paren": ["error", "always"],
512
+ "space-before-function-paren": ["error", "never"],
258
513
  "space-in-parens": ["error", "never"],
259
514
  "space-infix-ops": "error",
260
515
  "space-unary-ops": ["error", { words: true, nonwords: false }],
@@ -418,8 +673,8 @@ var js = [
418
673
  "max-lines-per-function": "off"
419
674
  }
420
675
  }
421
- ];
422
- var jsx = [
676
+ ]);
677
+ var jsx = defineFlatConfig8([
423
678
  {
424
679
  files: ["**/*.jsx"],
425
680
  languageOptions: {
@@ -430,352 +685,118 @@ var jsx = [
430
685
  }
431
686
  }
432
687
  }
433
- ];
434
- var imports = [
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
710
+ }
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"],
742
+ rules: {
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"
758
+ }
759
+ }
760
+ ]);
761
+
762
+ // src/configs/unocss.ts
763
+ import { defineFlatConfig as defineFlatConfig10 } from "eslint-define-config";
764
+ var unocss = defineFlatConfig10([
435
765
  {
436
766
  plugins: {
437
- import: importPlugin
438
- },
439
- settings: {
440
- "import/resolver": {
441
- node: { extensions: [".js", ".mjs", ".ts", ".mts", ".d.ts"] }
442
- }
767
+ unocss: default4
443
768
  },
444
769
  rules: {
445
- "import/no-unresolved": "off",
446
- "import/no-absolute-path": "off",
447
- "import/no-named-as-default-member": "off",
448
- "import/newline-after-import": "error",
449
- "import/first": "error",
450
- "import/no-mutable-exports": "error",
451
- "import/no-duplicates": "error",
452
- "import/order": [
453
- "error",
454
- {
455
- groups: [
456
- "builtin",
457
- "external",
458
- "internal",
459
- "parent",
460
- "sibling",
461
- "index",
462
- "object",
463
- "type"
464
- ],
465
- "newlines-between": "never",
466
- pathGroups: [{ pattern: "@/**", group: "internal" }],
467
- pathGroupsExcludedImportTypes: ["type"]
468
- }
469
- ]
770
+ "unocss/order": "error",
771
+ // We don't use this
772
+ "unocss/order-attributify": "off"
470
773
  }
471
774
  }
472
- ];
473
- var unicorn = [
775
+ ]);
776
+
777
+ // src/configs/yml.ts
778
+ import { defineFlatConfig as defineFlatConfig11 } from "eslint-define-config";
779
+ var yml = defineFlatConfig11([
474
780
  {
781
+ files: [GLOB_YAML],
782
+ languageOptions: {
783
+ parser: parserYaml
784
+ },
475
785
  plugins: {
476
- unicorn: unicornPlugin
786
+ yml: default9
477
787
  },
478
788
  rules: {
479
- "unicorn/no-unsafe-regex": "off",
480
- "unicorn/error-message": "error",
481
- "unicorn/escape-case": "error",
482
- "unicorn/no-new-buffer": "error",
483
- "unicorn/number-literal-case": "error",
484
- "unicorn/prefer-includes": "error",
485
- "unicorn/prefer-type-error": "error",
486
- "unicorn/throw-new-error": "error",
487
- "unicorn/no-unnecessary-await": "error",
488
- "unicorn/switch-case-braces": ["error", "avoid"],
489
- "unicorn/no-typeof-undefined": "error",
490
- "unicorn/prefer-set-size": "error",
491
- "unicorn/better-regex": "error",
492
- "unicorn/custom-error-definition": "error",
493
- "unicorn/explicit-length-check": "error",
494
- "unicorn/new-for-builtins": "error",
495
- "unicorn/no-console-spaces": "error",
496
- "unicorn/no-for-loop": "error",
497
- "unicorn/no-hex-escape": "error",
498
- "unicorn/no-lonely-if": "error",
499
- "unicorn/prefer-keyboard-event-key": "error",
500
- "unicorn/prefer-math-trunc": "error",
501
- "unicorn/prefer-negative-index": "error",
502
- "unicorn/prefer-node-protocol": "error",
503
- "unicorn/prefer-number-properties": "error",
504
- "unicorn/prefer-optional-catch-binding": "error",
505
- "unicorn/prefer-prototype-methods": "error",
506
- "unicorn/prefer-reflect-apply": "error",
507
- "unicorn/prefer-date-now": "error",
508
- // String
509
- "unicorn/prefer-string-slice": "error",
510
- "unicorn/prefer-string-trim-start-end": "error",
511
- "unicorn/prefer-string-starts-ends-with": "error",
512
- // DOM
513
- "unicorn/prefer-add-event-listener": "error",
514
- "unicorn/no-invalid-remove-event-listener": "error",
515
- "unicorn/prefer-query-selector": "error",
516
- "unicorn/prefer-modern-dom-apis": "error",
517
- "unicorn/prefer-dom-node-append": "error",
518
- "unicorn/prefer-dom-node-dataset": "error",
519
- "unicorn/prefer-dom-node-remove": "error",
520
- "unicorn/prefer-dom-node-text-content": "error",
521
- // Array
522
- "unicorn/no-new-array": "error",
523
- "unicorn/no-instanceof-array": "error",
524
- "unicorn/no-array-push-push": "error",
525
- "unicorn/no-array-callback-reference": "error",
526
- "unicorn/no-array-method-this-argument": "error",
527
- "unicorn/prefer-array-find": "error",
528
- "unicorn/prefer-array-some": "error",
529
- "unicorn/prefer-array-flat-map": "error",
530
- "unicorn/prefer-array-index-of": "error"
531
- }
532
- }
533
- ];
534
-
535
- // src/configs/ts.ts
536
- import tsParser from "@typescript-eslint/parser";
537
- import tsPlugin from "@typescript-eslint/eslint-plugin";
538
- var ts = [
539
- {
540
- files: [GLOB_TS, GLOB_TSX],
541
- languageOptions: {
542
- // @ts-expect-error 2322
543
- parser: tsParser,
544
- parserOptions: {
545
- sourceType: "module"
546
- }
547
- },
548
- plugins: {
549
- "@typescript-eslint": tsPlugin
550
- },
551
- rules: {
552
- ...tsPlugin.configs["eslint-recommended"].overrides[0].rules,
553
- ...tsPlugin.configs.recommended.rules,
554
- "@typescript-eslint/no-unused-vars": "error",
555
- "@typescript-eslint/no-redeclare": "error",
556
- "@typescript-eslint/consistent-type-imports": [
557
- "error",
558
- {
559
- prefer: "type-imports",
560
- fixStyle: "separate-type-imports",
561
- disallowTypeAnnotations: false
562
- }
563
- ],
564
- "@typescript-eslint/prefer-as-const": "warn",
565
- "@typescript-eslint/ban-types": "off",
566
- "@typescript-eslint/camelcase": "off",
567
- "@typescript-eslint/no-namespace": "off",
568
- "@typescript-eslint/ban-ts-ignore": "off",
569
- "@typescript-eslint/ban-ts-comment": "off",
570
- "@typescript-eslint/no-explicit-any": "off",
571
- "@typescript-eslint/no-empty-function": "off",
572
- "@typescript-eslint/naming-convention": "off",
573
- "@typescript-eslint/no-empty-interface": "off",
574
- "@typescript-eslint/no-non-null-assertion": "off",
575
- "@typescript-eslint/triple-slash-reference": "off",
576
- "@typescript-eslint/no-parameter-properties": "off",
577
- "@typescript-eslint/explicit-member-accessibility": "off",
578
- "@typescript-eslint/explicit-function-return-type": "off",
579
- "@typescript-eslint/explicit-module-boundary-types": "off",
580
- "@typescript-eslint/consistent-indexed-object-style": "off"
581
- }
582
- },
583
- {
584
- files: ["**/*.d.ts"],
585
- rules: {
586
- "import/no-duplicates": "off",
587
- "import/newline-after-import": "off"
588
- }
589
- },
590
- {
591
- files: ["**/*.{spec,test}.ts?(x)"],
592
- rules: {
593
- "no-unused-expressions": "off",
594
- "max-lines-per-function": "off"
595
- }
596
- },
597
- {
598
- files: ["**/*.js", "**/*.cjs"],
599
- rules: {
600
- "@typescript-eslint/no-var-requires": "off"
601
- }
602
- }
603
- ];
604
-
605
- // src/configs/vue.ts
606
- import { getPackageInfoSync } from "local-pkg";
607
- import vuePlugin from "eslint-plugin-vue";
608
- import vueParser from "vue-eslint-parser";
609
- import tsPlugin2 from "@typescript-eslint/eslint-plugin";
610
- function getVueVersion() {
611
- const pkg = getPackageInfoSync("vue", { paths: [process.cwd()] });
612
- if (pkg && typeof pkg.version === "string" && !Number.isNaN(+pkg.version[0])) {
613
- return +pkg.version[0];
614
- }
615
- return 3;
616
- }
617
- var isVue3 = getVueVersion() === 3;
618
- var vueBaseRules = {};
619
- var vue2Rules = {
620
- ...vueBaseRules
621
- };
622
- var vue3Rules = {
623
- ...vueBaseRules
624
- };
625
- var vue = [
626
- {
627
- files: [GLOB_VUE],
628
- plugins: {
629
- vue: vuePlugin,
630
- "@typescript-eslint": tsPlugin2
631
- },
632
- languageOptions: {
633
- // @ts-expect-error 2322
634
- parser: vueParser,
635
- parserOptions: {
636
- parser: "@typescript-eslint/parser",
637
- sourceType: "module",
638
- extraFileExtensions: [".vue"],
639
- ecmaFeatures: {
640
- jsx: true
641
- }
642
- }
643
- },
644
- processor: vuePlugin.processors[".vue"],
645
- rules: {
646
- // @ts-expect-error 2339
647
- ...ts[0].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" }]
648
793
  }
649
- },
650
- {
651
- plugins: {
652
- vue: vuePlugin
653
- },
654
- rules: isVue3 ? vue3Rules : vue2Rules
655
794
  }
656
- ];
795
+ ]);
657
796
 
658
- // src/configs/yml.ts
659
- import ymlPlugin, { configs } from "eslint-plugin-yml";
660
- import ymlParser from "yaml-eslint-parser";
661
- var yml = [
662
- {
663
- files: [GLOB_YAML],
664
- languageOptions: {
665
- // @ts-expect-error 2322
666
- parser: ymlParser
667
- },
668
- plugins: {
669
- yml: ymlPlugin
670
- },
671
- // @ts-expect-error 2322
672
- rules: {
673
- ...configs.standard.rules,
674
- ...configs.prettier.rules,
675
- "yml/no-empty-mapping-value": "off"
676
- }
677
- }
678
- ];
679
-
680
- // src/configs/react.ts
681
- import reactPlugin from "eslint-plugin-react";
682
- import reactHooksPlugin from "eslint-plugin-react-hooks";
683
- var react = [
684
- {
685
- files: [GLOB_JSX, GLOB_TSX],
686
- plugins: {
687
- react: reactPlugin,
688
- reactHooks: reactHooksPlugin
689
- },
690
- settings: {
691
- react: {
692
- version: "18.0"
693
- }
694
- },
695
- languageOptions: {
696
- parserOptions: {
697
- ecmaFeatures: {
698
- jsx: true
699
- }
700
- }
701
- },
702
- rules: {
703
- ...reactPlugin.configs.recommended.rules,
704
- ...reactHooksPlugin.configs.recommended.rules,
705
- "jsx-quotes": ["error", "prefer-double"],
706
- "react/react-in-jsx-scope": "off"
707
- }
708
- }
709
- ];
710
-
711
- // src/configs/astro.ts
712
- import astroPlugin, { configs as configs2 } from "eslint-plugin-astro";
713
- import astroParser from "astro-eslint-parser";
714
- var astro = [
715
- {
716
- files: [GLOB_ASTRO],
717
- plugins: {
718
- astro: astroPlugin
719
- },
720
- languageOptions: {
721
- parser: astroParser,
722
- parserOptions: {
723
- parser: "@typescript-eslint/parser",
724
- extraFileExtensions: [".astro"]
725
- }
726
- },
727
- // @ts-expect-error 2322
728
- rules: {
729
- ...configs2.recommended.rules
730
- }
731
- }
732
- ];
733
-
734
- // src/configs/jsonc.ts
735
- import jsoncPlugin, { configs as configs3 } from "eslint-plugin-jsonc";
736
- import jsoncParser from "jsonc-eslint-parser";
737
- var jsonc = [
738
- {
739
- files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC, "**/*rc"],
740
- plugins: {
741
- jsonc: jsoncPlugin
742
- },
743
- languageOptions: {
744
- parser: jsoncParser
745
- },
746
- // @ts-expect-error 2322
747
- rules: {
748
- ...configs3["recommended-with-jsonc"].rules,
749
- "jsonc/array-bracket-spacing": ["error", "never"],
750
- "jsonc/comma-dangle": ["error", "never"],
751
- "jsonc/comma-style": ["error", "last"],
752
- "jsonc/indent": ["error", 2],
753
- "jsonc/key-spacing": [
754
- "error",
755
- {
756
- beforeColon: false,
757
- afterColon: true
758
- }
759
- ],
760
- "jsonc/no-octal-escape": "error",
761
- "jsonc/object-curly-newline": [
762
- "error",
763
- {
764
- multiline: true,
765
- consistent: true
766
- }
767
- ],
768
- "jsonc/object-curly-spacing": ["error", "always"],
769
- "jsonc/object-property-newline": [
770
- "error",
771
- {
772
- allowMultiplePropertiesPerLine: true
773
- }
774
- ]
775
- }
776
- }
777
- ];
778
- var pkgOrder = [
797
+ // src/configs/sort.ts
798
+ import { defineFlatConfig as defineFlatConfig12 } from "eslint-define-config";
799
+ var sortPackageJson = defineFlatConfig12([
779
800
  {
780
801
  files: ["**/package.json"],
781
802
  rules: {
@@ -831,148 +852,543 @@ var pkgOrder = [
831
852
  ]
832
853
  },
833
854
  {
834
- pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies$",
855
+ pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$",
835
856
  order: { type: "asc" }
836
857
  },
858
+ {
859
+ order: { type: "asc" },
860
+ pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$"
861
+ },
837
862
  {
838
863
  pathPattern: "^exports.*$",
839
- order: ["types", "require", "import"]
864
+ order: ["types", "import", "require", "default"]
840
865
  },
841
866
  {
842
867
  pathPattern: "^scripts$",
843
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" }
844
892
  }
845
893
  ]
846
894
  }
847
895
  }
848
- ];
849
-
850
- // src/configs/prettier.ts
851
- import prettierPlugin from "eslint-plugin-prettier";
852
- import prettierConfig from "eslint-config-prettier";
853
- var prettier = [
896
+ ]);
897
+ var sortTsConfig = defineFlatConfig12([
854
898
  {
855
- plugins: {
856
- prettier: prettierPlugin
857
- },
899
+ files: ["**/tsconfig.json", "**/tsconfig.*.json"],
858
900
  rules: {
859
- ...prettierConfig.rules,
860
- ...prettierPlugin.configs.recommended.rules,
861
- "prettier/prettier": "warn"
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
+ ]
862
1009
  }
863
1010
  }
864
- ];
1011
+ ]);
865
1012
 
866
- // src/configs/markdown.ts
867
- import markdownPlugin from "eslint-plugin-markdown";
868
- import tsPlugin3 from "@typescript-eslint/eslint-plugin";
869
- var markdown = [
1013
+ // src/configs/jsonc.ts
1014
+ import { defineFlatConfig as defineFlatConfig13 } from "eslint-define-config";
1015
+ var jsonc = defineFlatConfig13([
870
1016
  {
871
- files: [GLOB_MARKDOWN],
1017
+ files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC, "**/*rc"],
872
1018
  plugins: {
873
- markdown: markdownPlugin
1019
+ jsonc: default10
874
1020
  },
875
- processor: "markdown/markdown"
876
- },
877
- {
878
- files: [`**/*.md/${GLOB_SRC}`, `**/*.md/${GLOB_VUE}`],
879
1021
  languageOptions: {
880
- parserOptions: {
881
- ecmaFeatures: {
882
- impliedStrict: true
883
- }
884
- }
885
- },
886
- plugins: {
887
- "@typescript-eslint": tsPlugin3
1022
+ parser: parserJsonc
888
1023
  },
889
1024
  rules: {
890
- ...markdownPlugin.configs.recommended.overrides[1].rules,
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
+ ]
1052
+ }
1053
+ }
1054
+ ]);
1055
+
1056
+ // src/configs/markdown.ts
1057
+ import { defineFlatConfig as defineFlatConfig14 } from "eslint-define-config";
1058
+ var markdown = defineFlatConfig14([
1059
+ ...default7.configs.recommended,
1060
+ {
1061
+ files: [`${GLOB_MARKDOWN}/${GLOB_SRC}`, `${GLOB_MARKDOWN}/${GLOB_VUE}`],
1062
+ rules: {
891
1063
  "no-undef": "off",
892
1064
  "no-alert": "off",
893
1065
  "no-console": "off",
894
1066
  "no-unused-vars": "off",
895
1067
  "no-unused-expressions": "off",
896
1068
  "no-restricted-imports": "off",
1069
+ "node/prefer-global/buffer": "off",
1070
+ "node/prefer-global/process": "off",
897
1071
  "import/no-unresolved": "off",
1072
+ "unused-imports/no-unused-imports": "off",
1073
+ "unused-imports/no-unused-vars": "off",
898
1074
  "@typescript-eslint/comma-dangle": "off",
899
1075
  "@typescript-eslint/no-redeclare": "off",
1076
+ "@typescript-eslint/no-namespace": "off",
900
1077
  "@typescript-eslint/no-unused-vars": "off",
901
1078
  "@typescript-eslint/no-var-requires": "off",
902
- "@typescript-eslint/no-use-before-define": "off",
903
- "unused-imports/no-unused-imports": "off",
904
- "unused-imports/no-unused-vars": "off"
1079
+ "@typescript-eslint/no-extraneous-class": "off",
1080
+ "@typescript-eslint/no-use-before-define": "off"
905
1081
  }
906
1082
  }
907
- ];
1083
+ ]);
908
1084
 
909
- // src/configs/eslint-comments.ts
910
- import commentsPlugin from "eslint-plugin-eslint-comments";
911
- 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
+ }),
912
1114
  {
1115
+ files: [GLOB_VUE],
913
1116
  plugins: {
914
- "eslint-comments": commentsPlugin
1117
+ vue: default3,
1118
+ "@typescript-eslint": tseslint.plugin
915
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
+ }
1130
+ },
1131
+ processor: default3.processors[".vue"],
916
1132
  rules: {
917
- ...commentsPlugin.configs.recommended.rules,
918
- "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
+ ]
919
1346
  }
920
1347
  }
921
- ];
1348
+ ]);
922
1349
 
923
1350
  // src/presets.ts
924
- var GLOBAL_IGNORE = { ignores: GLOB_EXCLUDE };
925
- var basic = [
926
- GLOBAL_IGNORE,
927
- ...js,
1351
+ var presetJavaScript = [
1352
+ ...ignores,
1353
+ ...jsdoc,
928
1354
  ...jsx,
929
- ...ts,
930
- ...yml,
1355
+ ...node,
931
1356
  ...imports,
932
1357
  ...unicorn,
933
- ...jsonc,
934
- ...pkgOrder,
935
- ...eslintComments
936
- ];
937
- var all = [
938
- ...basic,
939
- ...vue,
940
- ...react,
941
- ...astro,
942
- ...prettier,
943
- ...markdown
1358
+ ...comments,
1359
+ ...javascript
944
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];
945
1366
  function ntnyq(config = [], {
946
- vue: enableVue = false,
947
- react: enableReact = false,
948
- astro: enableAstro = false,
949
- prettier: enablePrettier = false,
950
- markdown: enableMarkdown = false
1367
+ vue: enableVue = hasVue,
1368
+ unocss: enableUnoCSS = hasUnoCSS,
1369
+ prettier: enablePrettier = true,
1370
+ markdown: enableMarkdown = true
951
1371
  } = {}) {
952
- const configs4 = [...basic];
1372
+ const configs = defineFlatConfig16([...presetBasic, ...yml, ...presetJsonc]);
953
1373
  if (enableVue) {
954
- configs4.push(...vue);
1374
+ configs.push(...vue);
955
1375
  }
956
- if (enableReact) {
957
- configs4.push(...react);
1376
+ if (enableUnoCSS) {
1377
+ configs.push(...unocss);
958
1378
  }
959
- if (enableAstro) {
960
- configs4.push(...astro);
1379
+ if (enablePrettier) {
1380
+ configs.push(...prettier);
961
1381
  }
962
1382
  if (enableMarkdown) {
963
- configs4.push(...markdown);
964
- }
965
- if (enablePrettier) {
966
- configs4.push(...prettier);
1383
+ configs.push(...markdown);
967
1384
  }
968
1385
  if (Object.keys(config).length > 0) {
969
- configs4.push(...Array.isArray(config) ? config : [config]);
1386
+ configs.push(...Array.isArray(config) ? config : [config]);
970
1387
  }
971
- return configs4;
1388
+ return configs;
972
1389
  }
973
1390
  export {
974
1391
  GLOB_ALL_SRC,
975
- GLOB_ASTRO,
976
1392
  GLOB_CSS,
977
1393
  GLOB_DIST,
978
1394
  GLOB_EXCLUDE,
@@ -988,33 +1404,55 @@ export {
988
1404
  GLOB_NODE_MODULES,
989
1405
  GLOB_SCSS,
990
1406
  GLOB_SRC,
1407
+ GLOB_SRC_EXT,
991
1408
  GLOB_STYLE,
992
1409
  GLOB_TS,
993
1410
  GLOB_TSX,
994
1411
  GLOB_VUE,
995
1412
  GLOB_YAML,
996
- all,
997
- astro,
998
- basic,
999
- eslintComments,
1413
+ comments,
1000
1414
  getVueVersion,
1415
+ hasTypeScript,
1416
+ hasUnoCSS,
1417
+ hasVue,
1418
+ ignores,
1001
1419
  imports,
1002
- js,
1420
+ interopDefault,
1421
+ javascript,
1422
+ jsdoc,
1003
1423
  jsonc,
1004
1424
  jsx,
1005
1425
  markdown,
1426
+ node,
1006
1427
  ntnyq,
1007
- 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,
1008
1448
  prettier,
1009
- react,
1010
- reactHooksPlugin,
1011
- reactPlugin,
1012
- ts,
1013
- tsParser,
1014
- tsPlugin,
1449
+ sortPackageJson,
1450
+ sortTsConfig,
1451
+ tseslint,
1452
+ typescript,
1453
+ typescriptCore,
1015
1454
  unicorn,
1455
+ unocss,
1016
1456
  vue,
1017
- vueParser,
1018
- vuePlugin,
1019
1457
  yml
1020
1458
  };