@antfu/eslint-config 3.7.0 → 3.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.cjs CHANGED
@@ -41,7 +41,7 @@ var import_picocolors = __toESM(require("picocolors"), 1);
41
41
  var package_default = {
42
42
  name: "@antfu/eslint-config",
43
43
  type: "module",
44
- version: "3.7.0",
44
+ version: "3.7.2",
45
45
  packageManager: "pnpm@9.11.0",
46
46
  description: "Anthony's ESLint config",
47
47
  author: "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
@@ -141,20 +141,20 @@ var package_default = {
141
141
  "@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
142
142
  "@eslint/markdown": "^6.1.0",
143
143
  "@stylistic/eslint-plugin": "^2.8.0",
144
- "@typescript-eslint/eslint-plugin": "^8.6.0",
145
- "@typescript-eslint/parser": "^8.6.0",
144
+ "@typescript-eslint/eslint-plugin": "^8.7.0",
145
+ "@typescript-eslint/parser": "^8.7.0",
146
146
  "@vitest/eslint-plugin": "^1.1.4",
147
147
  "eslint-config-flat-gitignore": "^0.3.0",
148
148
  "eslint-flat-config-utils": "^0.4.0",
149
149
  "eslint-merge-processors": "^0.1.0",
150
150
  "eslint-plugin-antfu": "^2.7.0",
151
151
  "eslint-plugin-command": "^0.2.5",
152
- "eslint-plugin-import-x": "^4.2.1",
153
- "eslint-plugin-jsdoc": "^50.2.4",
152
+ "eslint-plugin-import-x": "^4.3.0",
153
+ "eslint-plugin-jsdoc": "^50.2.5",
154
154
  "eslint-plugin-jsonc": "^2.16.0",
155
155
  "eslint-plugin-n": "^17.10.3",
156
156
  "eslint-plugin-no-only-tests": "^3.3.0",
157
- "eslint-plugin-perfectionist": "^3.6.0",
157
+ "eslint-plugin-perfectionist": "^3.7.0",
158
158
  "eslint-plugin-regexp": "^2.6.0",
159
159
  "eslint-plugin-toml": "^0.11.1",
160
160
  "eslint-plugin-unicorn": "^55.0.0",
@@ -180,13 +180,13 @@ var package_default = {
180
180
  "@prettier/plugin-xml": "^3.4.1",
181
181
  "@stylistic/eslint-plugin-migrate": "^2.8.0",
182
182
  "@types/fs-extra": "^11.0.4",
183
- "@types/node": "^22.5.5",
183
+ "@types/node": "^22.7.2",
184
184
  "@types/prompts": "^2.4.9",
185
185
  "@types/yargs": "^17.0.33",
186
186
  "@unocss/eslint-plugin": "^0.62.4",
187
187
  "astro-eslint-parser": "^1.0.3",
188
188
  bumpp: "^9.5.2",
189
- eslint: "^9.10.0",
189
+ eslint: "^9.11.1",
190
190
  "eslint-plugin-astro": "^1.2.4",
191
191
  "eslint-plugin-format": "^0.1.2",
192
192
  "eslint-plugin-react-hooks": "^4.6.2",
@@ -198,7 +198,7 @@ var package_default = {
198
198
  execa: "^9.4.0",
199
199
  "fast-glob": "^3.3.2",
200
200
  "fs-extra": "^11.2.0",
201
- jiti: "^1.21.6",
201
+ jiti: "^2.0.0",
202
202
  "lint-staged": "^15.2.10",
203
203
  "prettier-plugin-astro": "^0.14.1",
204
204
  "prettier-plugin-slidev": "^1.0.5",
@@ -210,12 +210,12 @@ var package_default = {
210
210
  tsx: "^4.19.1",
211
211
  typescript: "^5.6.2",
212
212
  vitest: "^2.1.1",
213
- vue: "^3.5.6"
213
+ vue: "^3.5.8"
214
214
  },
215
215
  resolutions: {
216
216
  "@eslint-community/eslint-utils": "^4.4.0",
217
- "@typescript-eslint/utils": "^8.6.0",
218
- eslint: "^9.10.0",
217
+ "@typescript-eslint/utils": "^8.7.0",
218
+ eslint: "^9.11.1",
219
219
  tsx: "^4.19.1"
220
220
  },
221
221
  "simple-git-hooks": {
package/dist/cli.js CHANGED
@@ -12,7 +12,7 @@ import c from "picocolors";
12
12
  var package_default = {
13
13
  name: "@antfu/eslint-config",
14
14
  type: "module",
15
- version: "3.7.0",
15
+ version: "3.7.2",
16
16
  packageManager: "pnpm@9.11.0",
17
17
  description: "Anthony's ESLint config",
18
18
  author: "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
@@ -112,20 +112,20 @@ var package_default = {
112
112
  "@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
113
113
  "@eslint/markdown": "^6.1.0",
114
114
  "@stylistic/eslint-plugin": "^2.8.0",
115
- "@typescript-eslint/eslint-plugin": "^8.6.0",
116
- "@typescript-eslint/parser": "^8.6.0",
115
+ "@typescript-eslint/eslint-plugin": "^8.7.0",
116
+ "@typescript-eslint/parser": "^8.7.0",
117
117
  "@vitest/eslint-plugin": "^1.1.4",
118
118
  "eslint-config-flat-gitignore": "^0.3.0",
119
119
  "eslint-flat-config-utils": "^0.4.0",
120
120
  "eslint-merge-processors": "^0.1.0",
121
121
  "eslint-plugin-antfu": "^2.7.0",
122
122
  "eslint-plugin-command": "^0.2.5",
123
- "eslint-plugin-import-x": "^4.2.1",
124
- "eslint-plugin-jsdoc": "^50.2.4",
123
+ "eslint-plugin-import-x": "^4.3.0",
124
+ "eslint-plugin-jsdoc": "^50.2.5",
125
125
  "eslint-plugin-jsonc": "^2.16.0",
126
126
  "eslint-plugin-n": "^17.10.3",
127
127
  "eslint-plugin-no-only-tests": "^3.3.0",
128
- "eslint-plugin-perfectionist": "^3.6.0",
128
+ "eslint-plugin-perfectionist": "^3.7.0",
129
129
  "eslint-plugin-regexp": "^2.6.0",
130
130
  "eslint-plugin-toml": "^0.11.1",
131
131
  "eslint-plugin-unicorn": "^55.0.0",
@@ -151,13 +151,13 @@ var package_default = {
151
151
  "@prettier/plugin-xml": "^3.4.1",
152
152
  "@stylistic/eslint-plugin-migrate": "^2.8.0",
153
153
  "@types/fs-extra": "^11.0.4",
154
- "@types/node": "^22.5.5",
154
+ "@types/node": "^22.7.2",
155
155
  "@types/prompts": "^2.4.9",
156
156
  "@types/yargs": "^17.0.33",
157
157
  "@unocss/eslint-plugin": "^0.62.4",
158
158
  "astro-eslint-parser": "^1.0.3",
159
159
  bumpp: "^9.5.2",
160
- eslint: "^9.10.0",
160
+ eslint: "^9.11.1",
161
161
  "eslint-plugin-astro": "^1.2.4",
162
162
  "eslint-plugin-format": "^0.1.2",
163
163
  "eslint-plugin-react-hooks": "^4.6.2",
@@ -169,7 +169,7 @@ var package_default = {
169
169
  execa: "^9.4.0",
170
170
  "fast-glob": "^3.3.2",
171
171
  "fs-extra": "^11.2.0",
172
- jiti: "^1.21.6",
172
+ jiti: "^2.0.0",
173
173
  "lint-staged": "^15.2.10",
174
174
  "prettier-plugin-astro": "^0.14.1",
175
175
  "prettier-plugin-slidev": "^1.0.5",
@@ -181,12 +181,12 @@ var package_default = {
181
181
  tsx: "^4.19.1",
182
182
  typescript: "^5.6.2",
183
183
  vitest: "^2.1.1",
184
- vue: "^3.5.6"
184
+ vue: "^3.5.8"
185
185
  },
186
186
  resolutions: {
187
187
  "@eslint-community/eslint-utils": "^4.4.0",
188
- "@typescript-eslint/utils": "^8.6.0",
189
- eslint: "^9.10.0",
188
+ "@typescript-eslint/utils": "^8.7.0",
189
+ eslint: "^9.11.1",
190
190
  tsx: "^4.19.1"
191
191
  },
192
192
  "simple-git-hooks": {
package/dist/index.cjs CHANGED
@@ -107,7 +107,7 @@ __export(src_exports, {
107
107
  });
108
108
  module.exports = __toCommonJS(src_exports);
109
109
 
110
- // node_modules/.pnpm/tsup@8.3.0_jiti@1.21.6_postcss@8.4.44_tsx@4.19.1_typescript@5.6.2_yaml@2.5.0/node_modules/tsup/assets/cjs_shims.js
110
+ // node_modules/.pnpm/tsup@8.3.0_jiti@2.0.0_postcss@8.4.47_tsx@4.19.1_typescript@5.6.2_yaml@2.5.0/node_modules/tsup/assets/cjs_shims.js
111
111
  var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
112
112
  var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
113
113
 
@@ -438,6 +438,15 @@ async function disables() {
438
438
  rules: {
439
439
  "ts/no-require-imports": "off"
440
440
  }
441
+ },
442
+ {
443
+ files: [`**/*.config.${GLOB_SRC_EXT}`, `**/*.config.*.${GLOB_SRC_EXT}`],
444
+ name: "antfu/disables/config-files",
445
+ rules: {
446
+ "antfu/no-top-level-await": "off",
447
+ "no-console": "off",
448
+ "ts/explicit-function-return-type": "off"
449
+ }
441
450
  }
442
451
  ];
443
452
  }
@@ -498,6 +507,16 @@ async function stylistic(options = {}) {
498
507
  }
499
508
 
500
509
  // src/configs/formatters.ts
510
+ function mergePrettierOptions(options, overrides = {}) {
511
+ return {
512
+ ...options,
513
+ ...overrides,
514
+ plugins: [
515
+ ...overrides.plugins || [],
516
+ ...options.plugins || []
517
+ ]
518
+ };
519
+ }
501
520
  async function formatters(options = {}, stylistic2 = {}) {
502
521
  if (options === true) {
503
522
  const isPrettierPluginXmlInScope = isPackageInScope("@prettier/plugin-xml");
@@ -574,10 +593,9 @@ async function formatters(options = {}, stylistic2 = {}) {
574
593
  rules: {
575
594
  "format/prettier": [
576
595
  "error",
577
- {
578
- ...prettierOptions,
596
+ mergePrettierOptions(prettierOptions, {
579
597
  parser: "css"
580
- }
598
+ })
581
599
  ]
582
600
  }
583
601
  },
@@ -590,10 +608,9 @@ async function formatters(options = {}, stylistic2 = {}) {
590
608
  rules: {
591
609
  "format/prettier": [
592
610
  "error",
593
- {
594
- ...prettierOptions,
611
+ mergePrettierOptions(prettierOptions, {
595
612
  parser: "scss"
596
- }
613
+ })
597
614
  ]
598
615
  }
599
616
  },
@@ -606,10 +623,9 @@ async function formatters(options = {}, stylistic2 = {}) {
606
623
  rules: {
607
624
  "format/prettier": [
608
625
  "error",
609
- {
610
- ...prettierOptions,
626
+ mergePrettierOptions(prettierOptions, {
611
627
  parser: "less"
612
- }
628
+ })
613
629
  ]
614
630
  }
615
631
  }
@@ -625,10 +641,9 @@ async function formatters(options = {}, stylistic2 = {}) {
625
641
  rules: {
626
642
  "format/prettier": [
627
643
  "error",
628
- {
629
- ...prettierOptions,
644
+ mergePrettierOptions(prettierOptions, {
630
645
  parser: "html"
631
- }
646
+ })
632
647
  ]
633
648
  }
634
649
  });
@@ -643,14 +658,12 @@ async function formatters(options = {}, stylistic2 = {}) {
643
658
  rules: {
644
659
  "format/prettier": [
645
660
  "error",
646
- {
647
- ...prettierXmlOptions,
648
- ...prettierOptions,
661
+ mergePrettierOptions({ ...prettierXmlOptions, ...prettierOptions }, {
649
662
  parser: "xml",
650
663
  plugins: [
651
664
  "@prettier/plugin-xml"
652
665
  ]
653
- }
666
+ })
654
667
  ]
655
668
  }
656
669
  });
@@ -665,14 +678,12 @@ async function formatters(options = {}, stylistic2 = {}) {
665
678
  rules: {
666
679
  "format/prettier": [
667
680
  "error",
668
- {
669
- ...prettierXmlOptions,
670
- ...prettierOptions,
681
+ mergePrettierOptions({ ...prettierXmlOptions, ...prettierOptions }, {
671
682
  parser: "xml",
672
683
  plugins: [
673
684
  "@prettier/plugin-xml"
674
685
  ]
675
- }
686
+ })
676
687
  ]
677
688
  }
678
689
  });
@@ -690,11 +701,10 @@ async function formatters(options = {}, stylistic2 = {}) {
690
701
  rules: {
691
702
  [`format/${formater}`]: [
692
703
  "error",
693
- formater === "prettier" ? {
694
- ...prettierOptions,
704
+ formater === "prettier" ? mergePrettierOptions(prettierOptions, {
695
705
  embeddedLanguageFormatting: "off",
696
706
  parser: "markdown"
697
- } : {
707
+ }) : {
698
708
  ...dprintOptions,
699
709
  language: "markdown"
700
710
  }
@@ -711,14 +721,13 @@ async function formatters(options = {}, stylistic2 = {}) {
711
721
  rules: {
712
722
  "format/prettier": [
713
723
  "error",
714
- {
715
- ...prettierOptions,
724
+ mergePrettierOptions(prettierOptions, {
716
725
  embeddedLanguageFormatting: "off",
717
726
  parser: "slidev",
718
727
  plugins: [
719
728
  "prettier-plugin-slidev"
720
729
  ]
721
- }
730
+ })
722
731
  ]
723
732
  }
724
733
  });
@@ -734,13 +743,12 @@ async function formatters(options = {}, stylistic2 = {}) {
734
743
  rules: {
735
744
  "format/prettier": [
736
745
  "error",
737
- {
738
- ...prettierOptions,
746
+ mergePrettierOptions(prettierOptions, {
739
747
  parser: "astro",
740
748
  plugins: [
741
749
  "prettier-plugin-astro"
742
750
  ]
743
- }
751
+ })
744
752
  ]
745
753
  }
746
754
  });
@@ -768,10 +776,9 @@ async function formatters(options = {}, stylistic2 = {}) {
768
776
  rules: {
769
777
  "format/prettier": [
770
778
  "error",
771
- {
772
- ...prettierOptions,
779
+ mergePrettierOptions(prettierOptions, {
773
780
  parser: "graphql"
774
- }
781
+ })
775
782
  ]
776
783
  }
777
784
  });
@@ -1205,6 +1212,7 @@ async function markdown(options = {}) {
1205
1212
  },
1206
1213
  name: "antfu/markdown/disables",
1207
1214
  rules: {
1215
+ "antfu/no-top-level-await": "off",
1208
1216
  "import/newline-after-import": "off",
1209
1217
  "no-alert": "off",
1210
1218
  "no-console": "off",