@antfu/eslint-config 3.14.0 → 3.15.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/README.md CHANGED
@@ -730,7 +730,11 @@ export default antfu({
730
730
 
731
731
  ### Editor Specific Disables
732
732
 
733
- Some rules are disabled when inside ESLint IDE integrations, namely [`unused-imports/no-unused-imports`](https://www.npmjs.com/package/eslint-plugin-unused-imports) [`test/no-only-tests`](https://github.com/levibuzolic/eslint-plugin-no-only-tests)
733
+ Some rules are disabled when inside ESLint IDE integrations, namely:
734
+
735
+ - [`prefer-const`](https://eslint.org/docs/rules/prefer-const)
736
+ - [`unused-imports/no-unused-imports`](https://www.npmjs.com/package/eslint-plugin-unused-imports)
737
+ - [`test/no-only-tests`](https://github.com/levibuzolic/eslint-plugin-no-only-tests)
734
738
 
735
739
  This is to prevent unused imports from getting removed by the IDE during refactoring to get a better developer experience. Those rules will be applied when you run ESLint in the terminal or [Lint Staged](#lint-staged). If you don't want this behavior, you can disable them:
736
740
 
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.14.0",
44
+ version: "3.15.0",
45
45
  packageManager: "pnpm@10.0.0",
46
46
  description: "Anthony's ESLint config",
47
47
  author: "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
@@ -141,8 +141,8 @@ var package_default = {
141
141
  "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
142
142
  "@eslint/markdown": "^6.2.1",
143
143
  "@stylistic/eslint-plugin": "^2.13.0",
144
- "@typescript-eslint/eslint-plugin": "^8.19.1",
145
- "@typescript-eslint/parser": "^8.19.1",
144
+ "@typescript-eslint/eslint-plugin": "^8.20.0",
145
+ "@typescript-eslint/parser": "^8.20.0",
146
146
  "@vitest/eslint-plugin": "^1.1.25",
147
147
  "eslint-config-flat-gitignore": "^1.0.0",
148
148
  "eslint-flat-config-utils": "^1.0.0",
@@ -150,7 +150,7 @@ var package_default = {
150
150
  "eslint-plugin-antfu": "^2.7.0",
151
151
  "eslint-plugin-command": "^2.1.0",
152
152
  "eslint-plugin-import-x": "^4.6.1",
153
- "eslint-plugin-jsdoc": "^50.6.1",
153
+ "eslint-plugin-jsdoc": "^50.6.2",
154
154
  "eslint-plugin-jsonc": "^2.18.2",
155
155
  "eslint-plugin-n": "^17.15.1",
156
156
  "eslint-plugin-no-only-tests": "^3.3.0",
@@ -176,16 +176,16 @@ var package_default = {
176
176
  "@antfu/eslint-config": "workspace:*",
177
177
  "@antfu/ni": "^23.2.0",
178
178
  "@eslint-react/eslint-plugin": "^1.23.2",
179
- "@eslint/config-inspector": "^0.7.1",
179
+ "@eslint/config-inspector": "^1.0.0",
180
180
  "@prettier/plugin-xml": "^3.4.1",
181
181
  "@stylistic/eslint-plugin-migrate": "^2.13.0",
182
182
  "@types/fs-extra": "^11.0.4",
183
- "@types/node": "^22.10.5",
183
+ "@types/node": "^22.10.7",
184
184
  "@types/prompts": "^2.4.9",
185
185
  "@types/yargs": "^17.0.33",
186
- "@unocss/eslint-plugin": "^65.4.0",
186
+ "@unocss/eslint-plugin": "^65.4.2",
187
187
  "astro-eslint-parser": "^1.1.0",
188
- bumpp: "^9.10.0",
188
+ bumpp: "^9.10.1",
189
189
  eslint: "^9.18.0",
190
190
  "eslint-plugin-astro": "^1.3.1",
191
191
  "eslint-plugin-format": "^1.0.1",
@@ -196,24 +196,24 @@ var package_default = {
196
196
  "eslint-typegen": "^1.0.0",
197
197
  execa: "^9.5.2",
198
198
  "fast-glob": "^3.3.3",
199
- "fs-extra": "^11.2.0",
199
+ "fs-extra": "^11.3.0",
200
200
  jiti: "^2.4.2",
201
- "lint-staged": "^15.3.0",
201
+ "lint-staged": "^15.4.1",
202
202
  "prettier-plugin-astro": "^0.14.1",
203
203
  "prettier-plugin-slidev": "^1.0.5",
204
204
  rimraf: "^6.0.1",
205
205
  "simple-git-hooks": "^2.11.1",
206
- svelte: "^5.17.3",
206
+ svelte: "^5.19.0",
207
207
  "svelte-eslint-parser": "^0.43.0",
208
208
  tsup: "^8.3.5",
209
209
  tsx: "^4.19.2",
210
210
  typescript: "^5.7.3",
211
- vitest: "^2.1.8",
211
+ vitest: "^3.0.2",
212
212
  vue: "^3.5.13"
213
213
  },
214
214
  resolutions: {
215
215
  "@eslint-community/eslint-utils": "^4.4.1",
216
- "@typescript-eslint/utils": "^8.19.1",
216
+ "@typescript-eslint/utils": "^8.20.0",
217
217
  eslint: "^9.18.0",
218
218
  tsx: "^4.19.2"
219
219
  },
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.14.0",
15
+ version: "3.15.0",
16
16
  packageManager: "pnpm@10.0.0",
17
17
  description: "Anthony's ESLint config",
18
18
  author: "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
@@ -112,8 +112,8 @@ var package_default = {
112
112
  "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
113
113
  "@eslint/markdown": "^6.2.1",
114
114
  "@stylistic/eslint-plugin": "^2.13.0",
115
- "@typescript-eslint/eslint-plugin": "^8.19.1",
116
- "@typescript-eslint/parser": "^8.19.1",
115
+ "@typescript-eslint/eslint-plugin": "^8.20.0",
116
+ "@typescript-eslint/parser": "^8.20.0",
117
117
  "@vitest/eslint-plugin": "^1.1.25",
118
118
  "eslint-config-flat-gitignore": "^1.0.0",
119
119
  "eslint-flat-config-utils": "^1.0.0",
@@ -121,7 +121,7 @@ var package_default = {
121
121
  "eslint-plugin-antfu": "^2.7.0",
122
122
  "eslint-plugin-command": "^2.1.0",
123
123
  "eslint-plugin-import-x": "^4.6.1",
124
- "eslint-plugin-jsdoc": "^50.6.1",
124
+ "eslint-plugin-jsdoc": "^50.6.2",
125
125
  "eslint-plugin-jsonc": "^2.18.2",
126
126
  "eslint-plugin-n": "^17.15.1",
127
127
  "eslint-plugin-no-only-tests": "^3.3.0",
@@ -147,16 +147,16 @@ var package_default = {
147
147
  "@antfu/eslint-config": "workspace:*",
148
148
  "@antfu/ni": "^23.2.0",
149
149
  "@eslint-react/eslint-plugin": "^1.23.2",
150
- "@eslint/config-inspector": "^0.7.1",
150
+ "@eslint/config-inspector": "^1.0.0",
151
151
  "@prettier/plugin-xml": "^3.4.1",
152
152
  "@stylistic/eslint-plugin-migrate": "^2.13.0",
153
153
  "@types/fs-extra": "^11.0.4",
154
- "@types/node": "^22.10.5",
154
+ "@types/node": "^22.10.7",
155
155
  "@types/prompts": "^2.4.9",
156
156
  "@types/yargs": "^17.0.33",
157
- "@unocss/eslint-plugin": "^65.4.0",
157
+ "@unocss/eslint-plugin": "^65.4.2",
158
158
  "astro-eslint-parser": "^1.1.0",
159
- bumpp: "^9.10.0",
159
+ bumpp: "^9.10.1",
160
160
  eslint: "^9.18.0",
161
161
  "eslint-plugin-astro": "^1.3.1",
162
162
  "eslint-plugin-format": "^1.0.1",
@@ -167,24 +167,24 @@ var package_default = {
167
167
  "eslint-typegen": "^1.0.0",
168
168
  execa: "^9.5.2",
169
169
  "fast-glob": "^3.3.3",
170
- "fs-extra": "^11.2.0",
170
+ "fs-extra": "^11.3.0",
171
171
  jiti: "^2.4.2",
172
- "lint-staged": "^15.3.0",
172
+ "lint-staged": "^15.4.1",
173
173
  "prettier-plugin-astro": "^0.14.1",
174
174
  "prettier-plugin-slidev": "^1.0.5",
175
175
  rimraf: "^6.0.1",
176
176
  "simple-git-hooks": "^2.11.1",
177
- svelte: "^5.17.3",
177
+ svelte: "^5.19.0",
178
178
  "svelte-eslint-parser": "^0.43.0",
179
179
  tsup: "^8.3.5",
180
180
  tsx: "^4.19.2",
181
181
  typescript: "^5.7.3",
182
- vitest: "^2.1.8",
182
+ vitest: "^3.0.2",
183
183
  vue: "^3.5.13"
184
184
  },
185
185
  resolutions: {
186
186
  "@eslint-community/eslint-utils": "^4.4.1",
187
- "@typescript-eslint/utils": "^8.19.1",
187
+ "@typescript-eslint/utils": "^8.20.0",
188
188
  eslint: "^9.18.0",
189
189
  tsx: "^4.19.2"
190
190
  },
package/dist/index.cjs CHANGED
@@ -994,7 +994,7 @@ async function javascript(options = {}) {
994
994
  allowUnboundThis: true
995
995
  }
996
996
  ],
997
- "prefer-const": [
997
+ "prefer-const": isInEditor ? "off" : [
998
998
  "error",
999
999
  {
1000
1000
  destructuring: "all",
package/dist/index.d.cts CHANGED
@@ -5274,7 +5274,7 @@ interface RuleOptions {
5274
5274
  * Disallow using code marked as `@deprecated`
5275
5275
  * @see https://typescript-eslint.io/rules/no-deprecated
5276
5276
  */
5277
- 'ts/no-deprecated'?: Linter.RuleEntry<[]>
5277
+ 'ts/no-deprecated'?: Linter.RuleEntry<TsNoDeprecated>
5278
5278
  /**
5279
5279
  * Disallow duplicate class members
5280
5280
  * @see https://typescript-eslint.io/rules/no-dupe-class-members
@@ -5392,6 +5392,11 @@ interface RuleOptions {
5392
5392
  * @see https://typescript-eslint.io/rules/no-misused-promises
5393
5393
  */
5394
5394
  'ts/no-misused-promises'?: Linter.RuleEntry<TsNoMisusedPromises>
5395
+ /**
5396
+ * Disallow using the spread operator when it might cause unexpected behavior
5397
+ * @see https://typescript-eslint.io/rules/no-misused-spread
5398
+ */
5399
+ 'ts/no-misused-spread'?: Linter.RuleEntry<TsNoMisusedSpread>
5395
5400
  /**
5396
5401
  * Disallow enums from having both number and string members
5397
5402
  * @see https://typescript-eslint.io/rules/no-mixed-enums
@@ -13319,6 +13324,8 @@ type TsConsistentTypeAssertions = []|[({
13319
13324
  assertionStyle: "never"
13320
13325
  } | {
13321
13326
 
13327
+ arrayLiteralTypeAssertions?: ("allow" | "allow-as-parameter" | "never")
13328
+
13322
13329
  assertionStyle?: ("as" | "angle-bracket")
13323
13330
 
13324
13331
  objectLiteralTypeAssertions?: ("allow" | "allow-as-parameter" | "never")
@@ -13775,6 +13782,22 @@ type TsNoConfusingVoidExpression = []|[{
13775
13782
 
13776
13783
  ignoreVoidReturningFunctions?: boolean
13777
13784
  }]
13785
+ // ----- ts/no-deprecated -----
13786
+ type TsNoDeprecated = []|[{
13787
+
13788
+ allow?: (string | {
13789
+ from: "file"
13790
+ name: (string | [string, ...(string)[]])
13791
+ path?: string
13792
+ } | {
13793
+ from: "lib"
13794
+ name: (string | [string, ...(string)[]])
13795
+ } | {
13796
+ from: "package"
13797
+ name: (string | [string, ...(string)[]])
13798
+ package: string
13799
+ })[]
13800
+ }]
13778
13801
  // ----- ts/no-duplicate-type-constituents -----
13779
13802
  type TsNoDuplicateTypeConstituents = []|[{
13780
13803
 
@@ -13916,6 +13939,22 @@ type TsNoMisusedPromises = []|[{
13916
13939
  variables?: boolean
13917
13940
  })
13918
13941
  }]
13942
+ // ----- ts/no-misused-spread -----
13943
+ type TsNoMisusedSpread = []|[{
13944
+
13945
+ allow?: (string | {
13946
+ from: "file"
13947
+ name: (string | [string, ...(string)[]])
13948
+ path?: string
13949
+ } | {
13950
+ from: "lib"
13951
+ name: (string | [string, ...(string)[]])
13952
+ } | {
13953
+ from: "package"
13954
+ name: (string | [string, ...(string)[]])
13955
+ package: string
13956
+ })[]
13957
+ }]
13919
13958
  // ----- ts/no-namespace -----
13920
13959
  type TsNoNamespace = []|[{
13921
13960
 
@@ -13991,7 +14030,7 @@ type TsNoShadow = []|[{
13991
14030
 
13992
14031
  builtinGlobals?: boolean
13993
14032
 
13994
- hoist?: ("all" | "functions" | "never")
14033
+ hoist?: ("all" | "functions" | "functions-and-types" | "never" | "types")
13995
14034
 
13996
14035
  ignoreFunctionTypeParameterNameValueShadow?: boolean
13997
14036
 
package/dist/index.d.ts CHANGED
@@ -5274,7 +5274,7 @@ interface RuleOptions {
5274
5274
  * Disallow using code marked as `@deprecated`
5275
5275
  * @see https://typescript-eslint.io/rules/no-deprecated
5276
5276
  */
5277
- 'ts/no-deprecated'?: Linter.RuleEntry<[]>
5277
+ 'ts/no-deprecated'?: Linter.RuleEntry<TsNoDeprecated>
5278
5278
  /**
5279
5279
  * Disallow duplicate class members
5280
5280
  * @see https://typescript-eslint.io/rules/no-dupe-class-members
@@ -5392,6 +5392,11 @@ interface RuleOptions {
5392
5392
  * @see https://typescript-eslint.io/rules/no-misused-promises
5393
5393
  */
5394
5394
  'ts/no-misused-promises'?: Linter.RuleEntry<TsNoMisusedPromises>
5395
+ /**
5396
+ * Disallow using the spread operator when it might cause unexpected behavior
5397
+ * @see https://typescript-eslint.io/rules/no-misused-spread
5398
+ */
5399
+ 'ts/no-misused-spread'?: Linter.RuleEntry<TsNoMisusedSpread>
5395
5400
  /**
5396
5401
  * Disallow enums from having both number and string members
5397
5402
  * @see https://typescript-eslint.io/rules/no-mixed-enums
@@ -13319,6 +13324,8 @@ type TsConsistentTypeAssertions = []|[({
13319
13324
  assertionStyle: "never"
13320
13325
  } | {
13321
13326
 
13327
+ arrayLiteralTypeAssertions?: ("allow" | "allow-as-parameter" | "never")
13328
+
13322
13329
  assertionStyle?: ("as" | "angle-bracket")
13323
13330
 
13324
13331
  objectLiteralTypeAssertions?: ("allow" | "allow-as-parameter" | "never")
@@ -13775,6 +13782,22 @@ type TsNoConfusingVoidExpression = []|[{
13775
13782
 
13776
13783
  ignoreVoidReturningFunctions?: boolean
13777
13784
  }]
13785
+ // ----- ts/no-deprecated -----
13786
+ type TsNoDeprecated = []|[{
13787
+
13788
+ allow?: (string | {
13789
+ from: "file"
13790
+ name: (string | [string, ...(string)[]])
13791
+ path?: string
13792
+ } | {
13793
+ from: "lib"
13794
+ name: (string | [string, ...(string)[]])
13795
+ } | {
13796
+ from: "package"
13797
+ name: (string | [string, ...(string)[]])
13798
+ package: string
13799
+ })[]
13800
+ }]
13778
13801
  // ----- ts/no-duplicate-type-constituents -----
13779
13802
  type TsNoDuplicateTypeConstituents = []|[{
13780
13803
 
@@ -13916,6 +13939,22 @@ type TsNoMisusedPromises = []|[{
13916
13939
  variables?: boolean
13917
13940
  })
13918
13941
  }]
13942
+ // ----- ts/no-misused-spread -----
13943
+ type TsNoMisusedSpread = []|[{
13944
+
13945
+ allow?: (string | {
13946
+ from: "file"
13947
+ name: (string | [string, ...(string)[]])
13948
+ path?: string
13949
+ } | {
13950
+ from: "lib"
13951
+ name: (string | [string, ...(string)[]])
13952
+ } | {
13953
+ from: "package"
13954
+ name: (string | [string, ...(string)[]])
13955
+ package: string
13956
+ })[]
13957
+ }]
13919
13958
  // ----- ts/no-namespace -----
13920
13959
  type TsNoNamespace = []|[{
13921
13960
 
@@ -13991,7 +14030,7 @@ type TsNoShadow = []|[{
13991
14030
 
13992
14031
  builtinGlobals?: boolean
13993
14032
 
13994
- hoist?: ("all" | "functions" | "never")
14033
+ hoist?: ("all" | "functions" | "functions-and-types" | "never" | "types")
13995
14034
 
13996
14035
  ignoreFunctionTypeParameterNameValueShadow?: boolean
13997
14036
 
package/dist/index.js CHANGED
@@ -881,7 +881,7 @@ async function javascript(options = {}) {
881
881
  allowUnboundThis: true
882
882
  }
883
883
  ],
884
- "prefer-const": [
884
+ "prefer-const": isInEditor ? "off" : [
885
885
  "error",
886
886
  {
887
887
  destructuring: "all",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@antfu/eslint-config",
3
3
  "type": "module",
4
- "version": "3.14.0",
4
+ "version": "3.15.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,8 +86,8 @@
86
86
  "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
87
87
  "@eslint/markdown": "^6.2.1",
88
88
  "@stylistic/eslint-plugin": "^2.13.0",
89
- "@typescript-eslint/eslint-plugin": "^8.19.1",
90
- "@typescript-eslint/parser": "^8.19.1",
89
+ "@typescript-eslint/eslint-plugin": "^8.20.0",
90
+ "@typescript-eslint/parser": "^8.20.0",
91
91
  "@vitest/eslint-plugin": "^1.1.25",
92
92
  "eslint-config-flat-gitignore": "^1.0.0",
93
93
  "eslint-flat-config-utils": "^1.0.0",
@@ -95,7 +95,7 @@
95
95
  "eslint-plugin-antfu": "^2.7.0",
96
96
  "eslint-plugin-command": "^2.1.0",
97
97
  "eslint-plugin-import-x": "^4.6.1",
98
- "eslint-plugin-jsdoc": "^50.6.1",
98
+ "eslint-plugin-jsdoc": "^50.6.2",
99
99
  "eslint-plugin-jsonc": "^2.18.2",
100
100
  "eslint-plugin-n": "^17.15.1",
101
101
  "eslint-plugin-no-only-tests": "^3.3.0",
@@ -120,16 +120,16 @@
120
120
  "devDependencies": {
121
121
  "@antfu/ni": "^23.2.0",
122
122
  "@eslint-react/eslint-plugin": "^1.23.2",
123
- "@eslint/config-inspector": "^0.7.1",
123
+ "@eslint/config-inspector": "^1.0.0",
124
124
  "@prettier/plugin-xml": "^3.4.1",
125
125
  "@stylistic/eslint-plugin-migrate": "^2.13.0",
126
126
  "@types/fs-extra": "^11.0.4",
127
- "@types/node": "^22.10.5",
127
+ "@types/node": "^22.10.7",
128
128
  "@types/prompts": "^2.4.9",
129
129
  "@types/yargs": "^17.0.33",
130
- "@unocss/eslint-plugin": "^65.4.0",
130
+ "@unocss/eslint-plugin": "^65.4.2",
131
131
  "astro-eslint-parser": "^1.1.0",
132
- "bumpp": "^9.10.0",
132
+ "bumpp": "^9.10.1",
133
133
  "eslint": "^9.18.0",
134
134
  "eslint-plugin-astro": "^1.3.1",
135
135
  "eslint-plugin-format": "^1.0.1",
@@ -140,25 +140,25 @@
140
140
  "eslint-typegen": "^1.0.0",
141
141
  "execa": "^9.5.2",
142
142
  "fast-glob": "^3.3.3",
143
- "fs-extra": "^11.2.0",
143
+ "fs-extra": "^11.3.0",
144
144
  "jiti": "^2.4.2",
145
- "lint-staged": "^15.3.0",
145
+ "lint-staged": "^15.4.1",
146
146
  "prettier-plugin-astro": "^0.14.1",
147
147
  "prettier-plugin-slidev": "^1.0.5",
148
148
  "rimraf": "^6.0.1",
149
149
  "simple-git-hooks": "^2.11.1",
150
- "svelte": "^5.17.3",
150
+ "svelte": "^5.19.0",
151
151
  "svelte-eslint-parser": "^0.43.0",
152
152
  "tsup": "^8.3.5",
153
153
  "tsx": "^4.19.2",
154
154
  "typescript": "^5.7.3",
155
- "vitest": "^2.1.8",
155
+ "vitest": "^3.0.2",
156
156
  "vue": "^3.5.13",
157
- "@antfu/eslint-config": "3.14.0"
157
+ "@antfu/eslint-config": "3.15.0"
158
158
  },
159
159
  "resolutions": {
160
160
  "@eslint-community/eslint-utils": "^4.4.1",
161
- "@typescript-eslint/utils": "^8.19.1",
161
+ "@typescript-eslint/utils": "^8.20.0",
162
162
  "eslint": "^9.18.0",
163
163
  "tsx": "^4.19.2"
164
164
  },