@antfu/eslint-config 3.6.2 → 3.7.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/cli.cjs CHANGED
@@ -41,8 +41,8 @@ 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.6.2",
45
- packageManager: "pnpm@9.10.0",
44
+ version: "3.7.0",
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/)",
48
48
  license: "MIT",
@@ -141,18 +141,18 @@ 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.5.0",
145
- "@typescript-eslint/parser": "^8.5.0",
144
+ "@typescript-eslint/eslint-plugin": "^8.6.0",
145
+ "@typescript-eslint/parser": "^8.6.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
- "eslint-plugin-antfu": "^2.6.0",
150
+ "eslint-plugin-antfu": "^2.7.0",
151
151
  "eslint-plugin-command": "^0.2.5",
152
152
  "eslint-plugin-import-x": "^4.2.1",
153
- "eslint-plugin-jsdoc": "^50.2.3",
153
+ "eslint-plugin-jsdoc": "^50.2.4",
154
154
  "eslint-plugin-jsonc": "^2.16.0",
155
- "eslint-plugin-n": "^17.10.2",
155
+ "eslint-plugin-n": "^17.10.3",
156
156
  "eslint-plugin-no-only-tests": "^3.3.0",
157
157
  "eslint-plugin-perfectionist": "^3.6.0",
158
158
  "eslint-plugin-regexp": "^2.6.0",
@@ -175,7 +175,7 @@ var package_default = {
175
175
  devDependencies: {
176
176
  "@antfu/eslint-config": "workspace:*",
177
177
  "@antfu/ni": "^0.23.0",
178
- "@eslint-react/eslint-plugin": "^1.14.1",
178
+ "@eslint-react/eslint-plugin": "^1.14.2",
179
179
  "@eslint/config-inspector": "^0.5.4",
180
180
  "@prettier/plugin-xml": "^3.4.1",
181
181
  "@stylistic/eslint-plugin-migrate": "^2.8.0",
@@ -183,7 +183,7 @@ var package_default = {
183
183
  "@types/node": "^22.5.5",
184
184
  "@types/prompts": "^2.4.9",
185
185
  "@types/yargs": "^17.0.33",
186
- "@unocss/eslint-plugin": "^0.62.3",
186
+ "@unocss/eslint-plugin": "^0.62.4",
187
187
  "astro-eslint-parser": "^1.0.3",
188
188
  bumpp: "^9.5.2",
189
189
  eslint: "^9.10.0",
@@ -195,7 +195,7 @@ var package_default = {
195
195
  "eslint-plugin-svelte": "^2.44.0",
196
196
  "eslint-typegen": "^0.3.2",
197
197
  esno: "^4.7.0",
198
- execa: "^9.3.1",
198
+ execa: "^9.4.0",
199
199
  "fast-glob": "^3.3.2",
200
200
  "fs-extra": "^11.2.0",
201
201
  jiti: "^1.21.6",
@@ -206,15 +206,15 @@ var package_default = {
206
206
  "simple-git-hooks": "^2.11.1",
207
207
  svelte: "^4.2.19",
208
208
  "svelte-eslint-parser": "^0.41.1",
209
- tsup: "^8.2.4",
209
+ tsup: "^8.3.0",
210
210
  tsx: "^4.19.1",
211
211
  typescript: "^5.6.2",
212
212
  vitest: "^2.1.1",
213
- vue: "^3.5.5"
213
+ vue: "^3.5.6"
214
214
  },
215
215
  resolutions: {
216
216
  "@eslint-community/eslint-utils": "^4.4.0",
217
- "@typescript-eslint/utils": "^8.5.0",
217
+ "@typescript-eslint/utils": "^8.6.0",
218
218
  eslint: "^9.10.0",
219
219
  tsx: "^4.19.1"
220
220
  },
package/dist/cli.js CHANGED
@@ -12,8 +12,8 @@ import c from "picocolors";
12
12
  var package_default = {
13
13
  name: "@antfu/eslint-config",
14
14
  type: "module",
15
- version: "3.6.2",
16
- packageManager: "pnpm@9.10.0",
15
+ version: "3.7.0",
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/)",
19
19
  license: "MIT",
@@ -112,18 +112,18 @@ 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.5.0",
116
- "@typescript-eslint/parser": "^8.5.0",
115
+ "@typescript-eslint/eslint-plugin": "^8.6.0",
116
+ "@typescript-eslint/parser": "^8.6.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
- "eslint-plugin-antfu": "^2.6.0",
121
+ "eslint-plugin-antfu": "^2.7.0",
122
122
  "eslint-plugin-command": "^0.2.5",
123
123
  "eslint-plugin-import-x": "^4.2.1",
124
- "eslint-plugin-jsdoc": "^50.2.3",
124
+ "eslint-plugin-jsdoc": "^50.2.4",
125
125
  "eslint-plugin-jsonc": "^2.16.0",
126
- "eslint-plugin-n": "^17.10.2",
126
+ "eslint-plugin-n": "^17.10.3",
127
127
  "eslint-plugin-no-only-tests": "^3.3.0",
128
128
  "eslint-plugin-perfectionist": "^3.6.0",
129
129
  "eslint-plugin-regexp": "^2.6.0",
@@ -146,7 +146,7 @@ var package_default = {
146
146
  devDependencies: {
147
147
  "@antfu/eslint-config": "workspace:*",
148
148
  "@antfu/ni": "^0.23.0",
149
- "@eslint-react/eslint-plugin": "^1.14.1",
149
+ "@eslint-react/eslint-plugin": "^1.14.2",
150
150
  "@eslint/config-inspector": "^0.5.4",
151
151
  "@prettier/plugin-xml": "^3.4.1",
152
152
  "@stylistic/eslint-plugin-migrate": "^2.8.0",
@@ -154,7 +154,7 @@ var package_default = {
154
154
  "@types/node": "^22.5.5",
155
155
  "@types/prompts": "^2.4.9",
156
156
  "@types/yargs": "^17.0.33",
157
- "@unocss/eslint-plugin": "^0.62.3",
157
+ "@unocss/eslint-plugin": "^0.62.4",
158
158
  "astro-eslint-parser": "^1.0.3",
159
159
  bumpp: "^9.5.2",
160
160
  eslint: "^9.10.0",
@@ -166,7 +166,7 @@ var package_default = {
166
166
  "eslint-plugin-svelte": "^2.44.0",
167
167
  "eslint-typegen": "^0.3.2",
168
168
  esno: "^4.7.0",
169
- execa: "^9.3.1",
169
+ execa: "^9.4.0",
170
170
  "fast-glob": "^3.3.2",
171
171
  "fs-extra": "^11.2.0",
172
172
  jiti: "^1.21.6",
@@ -177,15 +177,15 @@ var package_default = {
177
177
  "simple-git-hooks": "^2.11.1",
178
178
  svelte: "^4.2.19",
179
179
  "svelte-eslint-parser": "^0.41.1",
180
- tsup: "^8.2.4",
180
+ tsup: "^8.3.0",
181
181
  tsx: "^4.19.1",
182
182
  typescript: "^5.6.2",
183
183
  vitest: "^2.1.1",
184
- vue: "^3.5.5"
184
+ vue: "^3.5.6"
185
185
  },
186
186
  resolutions: {
187
187
  "@eslint-community/eslint-utils": "^4.4.0",
188
- "@typescript-eslint/utils": "^8.5.0",
188
+ "@typescript-eslint/utils": "^8.6.0",
189
189
  eslint: "^9.10.0",
190
190
  tsx: "^4.19.1"
191
191
  },
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.2.4_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@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
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
 
@@ -393,6 +393,7 @@ async function disables() {
393
393
  files: [`**/scripts/${GLOB_SRC}`],
394
394
  name: "antfu/disables/scripts",
395
395
  rules: {
396
+ "antfu/no-top-level-await": "off",
396
397
  "no-console": "off",
397
398
  "ts/explicit-function-return-type": "off"
398
399
  }
@@ -401,6 +402,7 @@ async function disables() {
401
402
  files: [`**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
402
403
  name: "antfu/disables/cli",
403
404
  rules: {
405
+ "antfu/no-top-level-await": "off",
404
406
  "no-console": "off"
405
407
  }
406
408
  },
@@ -426,6 +428,7 @@ async function disables() {
426
428
  files: ["**/*.{test,spec}.([tj])s?(x)"],
427
429
  name: "antfu/disables/test",
428
430
  rules: {
431
+ "antfu/no-top-level-await": "off",
429
432
  "no-unused-expressions": "off"
430
433
  }
431
434
  },
@@ -860,6 +863,7 @@ async function javascript(options = {}) {
860
863
  },
861
864
  rules: {
862
865
  "accessor-pairs": ["error", { enforceForClassMembers: true, setWithoutGet: true }],
866
+ "antfu/no-top-level-await": "error",
863
867
  "array-callback-return": "error",
864
868
  "block-scoped-var": "error",
865
869
  "constructor-super": "error",
@@ -1215,6 +1219,7 @@ async function markdown(options = {}) {
1215
1219
  "style/comma-dangle": "off",
1216
1220
  "style/eol-last": "off",
1217
1221
  "ts/consistent-type-imports": "off",
1222
+ "ts/explicit-function-return-type": "off",
1218
1223
  "ts/no-namespace": "off",
1219
1224
  "ts/no-redeclare": "off",
1220
1225
  "ts/no-require-imports": "off",
@@ -2289,7 +2294,9 @@ async function vue(options = {}) {
2289
2294
  ...pluginVue.configs["vue3-strongly-recommended"].rules,
2290
2295
  ...pluginVue.configs["vue3-recommended"].rules
2291
2296
  },
2297
+ "antfu/no-top-level-await": "off",
2292
2298
  "node/prefer-global/process": "off",
2299
+ "ts/explicit-function-return-type": "off",
2293
2300
  "vue/block-order": ["error", {
2294
2301
  order: ["script", "template", "style"]
2295
2302
  }],
package/dist/index.d.cts CHANGED
@@ -55,6 +55,11 @@ interface RuleOptions {
55
55
  * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/no-import-node-modules-by-path.test.ts
56
56
  */
57
57
  'antfu/no-import-node-modules-by-path'?: Linter.RuleEntry<[]>
58
+ /**
59
+ * Prevent using top-level await
60
+ * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/no-top-level-await.test.ts
61
+ */
62
+ 'antfu/no-top-level-await'?: Linter.RuleEntry<[]>
58
63
  /**
59
64
  * Do not use `exports =`
60
65
  * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/no-ts-export-equal.test.ts
@@ -13394,6 +13399,19 @@ type TsRestrictTemplateExpressions = []|[{
13394
13399
  allowRegExp?: boolean
13395
13400
 
13396
13401
  allowNever?: boolean
13402
+
13403
+ allow?: (string | {
13404
+ from: "file"
13405
+ name: (string | [string, ...(string)[]])
13406
+ path?: string
13407
+ } | {
13408
+ from: "lib"
13409
+ name: (string | [string, ...(string)[]])
13410
+ } | {
13411
+ from: "package"
13412
+ name: (string | [string, ...(string)[]])
13413
+ package: string
13414
+ })[]
13397
13415
  }]
13398
13416
  // ----- ts/return-await -----
13399
13417
  type TsReturnAwait = []|[(("always" | "error-handling-correctness-only" | "in-try-catch" | "never") & string)]
package/dist/index.d.ts CHANGED
@@ -55,6 +55,11 @@ interface RuleOptions {
55
55
  * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/no-import-node-modules-by-path.test.ts
56
56
  */
57
57
  'antfu/no-import-node-modules-by-path'?: Linter.RuleEntry<[]>
58
+ /**
59
+ * Prevent using top-level await
60
+ * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/no-top-level-await.test.ts
61
+ */
62
+ 'antfu/no-top-level-await'?: Linter.RuleEntry<[]>
58
63
  /**
59
64
  * Do not use `exports =`
60
65
  * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/no-ts-export-equal.test.ts
@@ -13394,6 +13399,19 @@ type TsRestrictTemplateExpressions = []|[{
13394
13399
  allowRegExp?: boolean
13395
13400
 
13396
13401
  allowNever?: boolean
13402
+
13403
+ allow?: (string | {
13404
+ from: "file"
13405
+ name: (string | [string, ...(string)[]])
13406
+ path?: string
13407
+ } | {
13408
+ from: "lib"
13409
+ name: (string | [string, ...(string)[]])
13410
+ } | {
13411
+ from: "package"
13412
+ name: (string | [string, ...(string)[]])
13413
+ package: string
13414
+ })[]
13397
13415
  }]
13398
13416
  // ----- ts/return-await -----
13399
13417
  type TsReturnAwait = []|[(("always" | "error-handling-correctness-only" | "in-try-catch" | "never") & string)]
package/dist/index.js CHANGED
@@ -280,6 +280,7 @@ async function disables() {
280
280
  files: [`**/scripts/${GLOB_SRC}`],
281
281
  name: "antfu/disables/scripts",
282
282
  rules: {
283
+ "antfu/no-top-level-await": "off",
283
284
  "no-console": "off",
284
285
  "ts/explicit-function-return-type": "off"
285
286
  }
@@ -288,6 +289,7 @@ async function disables() {
288
289
  files: [`**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
289
290
  name: "antfu/disables/cli",
290
291
  rules: {
292
+ "antfu/no-top-level-await": "off",
291
293
  "no-console": "off"
292
294
  }
293
295
  },
@@ -313,6 +315,7 @@ async function disables() {
313
315
  files: ["**/*.{test,spec}.([tj])s?(x)"],
314
316
  name: "antfu/disables/test",
315
317
  rules: {
318
+ "antfu/no-top-level-await": "off",
316
319
  "no-unused-expressions": "off"
317
320
  }
318
321
  },
@@ -747,6 +750,7 @@ async function javascript(options = {}) {
747
750
  },
748
751
  rules: {
749
752
  "accessor-pairs": ["error", { enforceForClassMembers: true, setWithoutGet: true }],
753
+ "antfu/no-top-level-await": "error",
750
754
  "array-callback-return": "error",
751
755
  "block-scoped-var": "error",
752
756
  "constructor-super": "error",
@@ -1102,6 +1106,7 @@ async function markdown(options = {}) {
1102
1106
  "style/comma-dangle": "off",
1103
1107
  "style/eol-last": "off",
1104
1108
  "ts/consistent-type-imports": "off",
1109
+ "ts/explicit-function-return-type": "off",
1105
1110
  "ts/no-namespace": "off",
1106
1111
  "ts/no-redeclare": "off",
1107
1112
  "ts/no-require-imports": "off",
@@ -2176,7 +2181,9 @@ async function vue(options = {}) {
2176
2181
  ...pluginVue.configs["vue3-strongly-recommended"].rules,
2177
2182
  ...pluginVue.configs["vue3-recommended"].rules
2178
2183
  },
2184
+ "antfu/no-top-level-await": "off",
2179
2185
  "node/prefer-global/process": "off",
2186
+ "ts/explicit-function-return-type": "off",
2180
2187
  "vue/block-order": ["error", {
2181
2188
  order: ["script", "template", "style"]
2182
2189
  }],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@antfu/eslint-config",
3
3
  "type": "module",
4
- "version": "3.6.2",
4
+ "version": "3.7.0",
5
5
  "description": "Anthony's ESLint config",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
7
7
  "license": "MIT",
@@ -86,18 +86,18 @@
86
86
  "@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
87
87
  "@eslint/markdown": "^6.1.0",
88
88
  "@stylistic/eslint-plugin": "^2.8.0",
89
- "@typescript-eslint/eslint-plugin": "^8.5.0",
90
- "@typescript-eslint/parser": "^8.5.0",
89
+ "@typescript-eslint/eslint-plugin": "^8.6.0",
90
+ "@typescript-eslint/parser": "^8.6.0",
91
91
  "@vitest/eslint-plugin": "^1.1.4",
92
92
  "eslint-config-flat-gitignore": "^0.3.0",
93
93
  "eslint-flat-config-utils": "^0.4.0",
94
94
  "eslint-merge-processors": "^0.1.0",
95
- "eslint-plugin-antfu": "^2.6.0",
95
+ "eslint-plugin-antfu": "^2.7.0",
96
96
  "eslint-plugin-command": "^0.2.5",
97
97
  "eslint-plugin-import-x": "^4.2.1",
98
- "eslint-plugin-jsdoc": "^50.2.3",
98
+ "eslint-plugin-jsdoc": "^50.2.4",
99
99
  "eslint-plugin-jsonc": "^2.16.0",
100
- "eslint-plugin-n": "^17.10.2",
100
+ "eslint-plugin-n": "^17.10.3",
101
101
  "eslint-plugin-no-only-tests": "^3.3.0",
102
102
  "eslint-plugin-perfectionist": "^3.6.0",
103
103
  "eslint-plugin-regexp": "^2.6.0",
@@ -119,7 +119,7 @@
119
119
  },
120
120
  "devDependencies": {
121
121
  "@antfu/ni": "^0.23.0",
122
- "@eslint-react/eslint-plugin": "^1.14.1",
122
+ "@eslint-react/eslint-plugin": "^1.14.2",
123
123
  "@eslint/config-inspector": "^0.5.4",
124
124
  "@prettier/plugin-xml": "^3.4.1",
125
125
  "@stylistic/eslint-plugin-migrate": "^2.8.0",
@@ -127,7 +127,7 @@
127
127
  "@types/node": "^22.5.5",
128
128
  "@types/prompts": "^2.4.9",
129
129
  "@types/yargs": "^17.0.33",
130
- "@unocss/eslint-plugin": "^0.62.3",
130
+ "@unocss/eslint-plugin": "^0.62.4",
131
131
  "astro-eslint-parser": "^1.0.3",
132
132
  "bumpp": "^9.5.2",
133
133
  "eslint": "^9.10.0",
@@ -139,7 +139,7 @@
139
139
  "eslint-plugin-svelte": "^2.44.0",
140
140
  "eslint-typegen": "^0.3.2",
141
141
  "esno": "^4.7.0",
142
- "execa": "^9.3.1",
142
+ "execa": "^9.4.0",
143
143
  "fast-glob": "^3.3.2",
144
144
  "fs-extra": "^11.2.0",
145
145
  "jiti": "^1.21.6",
@@ -150,16 +150,16 @@
150
150
  "simple-git-hooks": "^2.11.1",
151
151
  "svelte": "^4.2.19",
152
152
  "svelte-eslint-parser": "^0.41.1",
153
- "tsup": "^8.2.4",
153
+ "tsup": "^8.3.0",
154
154
  "tsx": "^4.19.1",
155
155
  "typescript": "^5.6.2",
156
156
  "vitest": "^2.1.1",
157
- "vue": "^3.5.5",
158
- "@antfu/eslint-config": "3.6.2"
157
+ "vue": "^3.5.6",
158
+ "@antfu/eslint-config": "3.7.0"
159
159
  },
160
160
  "resolutions": {
161
161
  "@eslint-community/eslint-utils": "^4.4.0",
162
- "@typescript-eslint/utils": "^8.5.0",
162
+ "@typescript-eslint/utils": "^8.6.0",
163
163
  "eslint": "^9.10.0",
164
164
  "tsx": "^4.19.1"
165
165
  },