@antfu/eslint-config 2.24.0 → 2.24.1

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
@@ -94,7 +94,12 @@ For example:
94
94
  }
95
95
  ```
96
96
 
97
- ## VS Code support (auto fix on save)
97
+ ## IDE Support (auto fix on save)
98
+
99
+ <details>
100
+ <summary>🟦 VS Code support</summary>
101
+
102
+ <br>
98
103
 
99
104
  Install [VS Code ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
100
105
 
@@ -143,6 +148,7 @@ Add the following settings to your `.vscode/settings.json`:
143
148
  "gql",
144
149
  "graphql",
145
150
  "astro",
151
+ "svelte",
146
152
  "css",
147
153
  "less",
148
154
  "scss",
@@ -152,6 +158,90 @@ Add the following settings to your `.vscode/settings.json`:
152
158
  }
153
159
  ```
154
160
 
161
+ </details>
162
+
163
+ <details>
164
+ <summary>🟩 Neovim Support</summary>
165
+
166
+ <br>
167
+
168
+ Update your configuration to use the following:
169
+
170
+ ```lua
171
+ local customizations = {
172
+ { rule = 'style/*', severity = 'off', fixable = true },
173
+ { rule = 'format/*', severity = 'off', fixable = true },
174
+ { rule = '*-indent', severity = 'off', fixable = true },
175
+ { rule = '*-spacing', severity = 'off', fixable = true },
176
+ { rule = '*-spaces', severity = 'off', fixable = true },
177
+ { rule = '*-order', severity = 'off', fixable = true },
178
+ { rule = '*-dangle', severity = 'off', fixable = true },
179
+ { rule = '*-newline', severity = 'off', fixable = true },
180
+ { rule = '*quotes', severity = 'off', fixable = true },
181
+ { rule = '*semi', severity = 'off', fixable = true },
182
+ }
183
+
184
+ local lspconfig = require('lspconfig')
185
+ -- Enable eslint for all supported languages
186
+ lspconfig.eslint.setup(
187
+ {
188
+ filetypes = {
189
+ "javascript",
190
+ "javascriptreact",
191
+ "javascript.jsx",
192
+ "typescript",
193
+ "typescriptreact",
194
+ "typescript.tsx",
195
+ "vue",
196
+ "html",
197
+ "markdown",
198
+ "json",
199
+ "jsonc",
200
+ "yaml",
201
+ "toml",
202
+ "xml",
203
+ "gql",
204
+ "graphql",
205
+ "astro",
206
+ "svelte",
207
+ "css",
208
+ "less",
209
+ "scss",
210
+ "pcss",
211
+ "postcss"
212
+ },
213
+ settings = {
214
+ -- Silent the stylistic rules in you IDE, but still auto fix them
215
+ rulesCustomizations = customizations,
216
+ },
217
+ }
218
+ )
219
+ ```
220
+
221
+ ### Neovim format on save
222
+
223
+ There's few ways you can achieve format on save in neovim:
224
+
225
+ - `nvim-lspconfig` has a `EslintFixAll` command predefined, you can create a autocmd to call this command after saving file.
226
+
227
+ ```lua
228
+ lspconfig.eslint.setup({
229
+ --- ...
230
+ on_attach = function(client, bufnr)
231
+ vim.api.nvim_create_autocmd("BufWritePre", {
232
+ buffer = bufnr,
233
+ command = "EslintFixAll",
234
+ })
235
+ end,
236
+ })
237
+ ```
238
+
239
+ - Use [conform.nvim](https://github.com/stevearc/conform.nvim).
240
+ - Use [none-ls](https://github.com/nvimtools/none-ls.nvim)
241
+ - Use [nvim-lint](https://github.com/mfussenegger/nvim-lint)
242
+
243
+ </details>
244
+
155
245
  ## Customization
156
246
 
157
247
  Since v1.0, we migrated to [ESLint Flat config](https://eslint.org/docs/latest/use/configure/configuration-files-new). It provides much better organization and composition.
package/dist/cli.cjs CHANGED
@@ -48,7 +48,7 @@ var import_picocolors = __toESM(require("picocolors"), 1);
48
48
  var package_default = {
49
49
  name: "@antfu/eslint-config",
50
50
  type: "module",
51
- version: "2.24.0",
51
+ version: "2.24.1",
52
52
  packageManager: "pnpm@9.6.0",
53
53
  description: "Anthony's ESLint config",
54
54
  author: "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
@@ -145,9 +145,9 @@ var package_default = {
145
145
  dependencies: {
146
146
  "@antfu/install-pkg": "^0.3.3",
147
147
  "@clack/prompts": "^0.7.0",
148
- "@stylistic/eslint-plugin": "^2.6.0-beta.1",
149
- "@typescript-eslint/eslint-plugin": "8.0.0-alpha.40",
150
- "@typescript-eslint/parser": "8.0.0-alpha.40",
148
+ "@stylistic/eslint-plugin": "^2.6.0",
149
+ "@typescript-eslint/eslint-plugin": "^8.0.0",
150
+ "@typescript-eslint/parser": "^8.0.0",
151
151
  "eslint-config-flat-gitignore": "^0.1.8",
152
152
  "eslint-flat-config-utils": "^0.3.0",
153
153
  "eslint-merge-processors": "^0.1.0",
@@ -155,7 +155,7 @@ var package_default = {
155
155
  "eslint-plugin-command": "^0.2.3",
156
156
  "eslint-plugin-eslint-comments": "^3.2.0",
157
157
  "eslint-plugin-import-x": "^3.1.0",
158
- "eslint-plugin-jsdoc": "^48.8.3",
158
+ "eslint-plugin-jsdoc": "^48.10.2",
159
159
  "eslint-plugin-jsonc": "^2.16.0",
160
160
  "eslint-plugin-markdown": "^5.1.0",
161
161
  "eslint-plugin-n": "^17.10.1",
@@ -182,16 +182,16 @@ var package_default = {
182
182
  devDependencies: {
183
183
  "@antfu/eslint-config": "workspace:*",
184
184
  "@antfu/ni": "^0.22.0",
185
- "@eslint-react/eslint-plugin": "^1.6.0",
185
+ "@eslint-react/eslint-plugin": "^1.7.1",
186
186
  "@eslint/config-inspector": "^0.5.2",
187
187
  "@prettier/plugin-xml": "^3.4.1",
188
- "@stylistic/eslint-plugin-migrate": "^2.4.0",
188
+ "@stylistic/eslint-plugin-migrate": "^2.6.0",
189
189
  "@types/eslint": "^9.6.0",
190
190
  "@types/fs-extra": "^11.0.4",
191
- "@types/node": "^20.14.12",
191
+ "@types/node": "^22.0.2",
192
192
  "@types/prompts": "^2.4.9",
193
193
  "@types/yargs": "^17.0.32",
194
- "@unocss/eslint-plugin": "^0.61.6",
194
+ "@unocss/eslint-plugin": "^0.61.9",
195
195
  "astro-eslint-parser": "^1.0.2",
196
196
  bumpp: "^9.4.1",
197
197
  eslint: "npm:eslint-ts-patch@9.5.0-0",
@@ -215,13 +215,13 @@ var package_default = {
215
215
  svelte: "^4.2.18",
216
216
  "svelte-eslint-parser": "^0.41.0",
217
217
  tsup: "^8.2.3",
218
- tsx: "^4.16.2",
218
+ tsx: "^4.16.3",
219
219
  typescript: "^5.5.4",
220
- vitest: "^2.0.4",
221
- vue: "^3.4.34"
220
+ vitest: "^2.0.5",
221
+ vue: "^3.4.35"
222
222
  },
223
223
  resolutions: {
224
- tsx: "~4.16.2"
224
+ tsx: "~4.16.3"
225
225
  },
226
226
  "simple-git-hooks": {
227
227
  "pre-commit": "npx lint-staged"
package/dist/cli.js CHANGED
@@ -19,7 +19,7 @@ import c from "picocolors";
19
19
  var package_default = {
20
20
  name: "@antfu/eslint-config",
21
21
  type: "module",
22
- version: "2.24.0",
22
+ version: "2.24.1",
23
23
  packageManager: "pnpm@9.6.0",
24
24
  description: "Anthony's ESLint config",
25
25
  author: "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
@@ -116,9 +116,9 @@ var package_default = {
116
116
  dependencies: {
117
117
  "@antfu/install-pkg": "^0.3.3",
118
118
  "@clack/prompts": "^0.7.0",
119
- "@stylistic/eslint-plugin": "^2.6.0-beta.1",
120
- "@typescript-eslint/eslint-plugin": "8.0.0-alpha.40",
121
- "@typescript-eslint/parser": "8.0.0-alpha.40",
119
+ "@stylistic/eslint-plugin": "^2.6.0",
120
+ "@typescript-eslint/eslint-plugin": "^8.0.0",
121
+ "@typescript-eslint/parser": "^8.0.0",
122
122
  "eslint-config-flat-gitignore": "^0.1.8",
123
123
  "eslint-flat-config-utils": "^0.3.0",
124
124
  "eslint-merge-processors": "^0.1.0",
@@ -126,7 +126,7 @@ var package_default = {
126
126
  "eslint-plugin-command": "^0.2.3",
127
127
  "eslint-plugin-eslint-comments": "^3.2.0",
128
128
  "eslint-plugin-import-x": "^3.1.0",
129
- "eslint-plugin-jsdoc": "^48.8.3",
129
+ "eslint-plugin-jsdoc": "^48.10.2",
130
130
  "eslint-plugin-jsonc": "^2.16.0",
131
131
  "eslint-plugin-markdown": "^5.1.0",
132
132
  "eslint-plugin-n": "^17.10.1",
@@ -153,16 +153,16 @@ var package_default = {
153
153
  devDependencies: {
154
154
  "@antfu/eslint-config": "workspace:*",
155
155
  "@antfu/ni": "^0.22.0",
156
- "@eslint-react/eslint-plugin": "^1.6.0",
156
+ "@eslint-react/eslint-plugin": "^1.7.1",
157
157
  "@eslint/config-inspector": "^0.5.2",
158
158
  "@prettier/plugin-xml": "^3.4.1",
159
- "@stylistic/eslint-plugin-migrate": "^2.4.0",
159
+ "@stylistic/eslint-plugin-migrate": "^2.6.0",
160
160
  "@types/eslint": "^9.6.0",
161
161
  "@types/fs-extra": "^11.0.4",
162
- "@types/node": "^20.14.12",
162
+ "@types/node": "^22.0.2",
163
163
  "@types/prompts": "^2.4.9",
164
164
  "@types/yargs": "^17.0.32",
165
- "@unocss/eslint-plugin": "^0.61.6",
165
+ "@unocss/eslint-plugin": "^0.61.9",
166
166
  "astro-eslint-parser": "^1.0.2",
167
167
  bumpp: "^9.4.1",
168
168
  eslint: "npm:eslint-ts-patch@9.5.0-0",
@@ -186,13 +186,13 @@ var package_default = {
186
186
  svelte: "^4.2.18",
187
187
  "svelte-eslint-parser": "^0.41.0",
188
188
  tsup: "^8.2.3",
189
- tsx: "^4.16.2",
189
+ tsx: "^4.16.3",
190
190
  typescript: "^5.5.4",
191
- vitest: "^2.0.4",
192
- vue: "^3.4.34"
191
+ vitest: "^2.0.5",
192
+ vue: "^3.4.35"
193
193
  },
194
194
  resolutions: {
195
- tsx: "~4.16.2"
195
+ tsx: "~4.16.3"
196
196
  },
197
197
  "simple-git-hooks": {
198
198
  "pre-commit": "npx lint-staged"
package/dist/index.d.cts CHANGED
@@ -5374,6 +5374,11 @@ interface RuleOptions {
5374
5374
  * @see https://typescript-eslint.io/rules/no-unnecessary-condition
5375
5375
  */
5376
5376
  'ts/no-unnecessary-condition'?: Linter.RuleEntry<TsNoUnnecessaryCondition>
5377
+ /**
5378
+ * Disallow unnecessary assignment of constructor property parameter
5379
+ * @see https://typescript-eslint.io/rules/no-unnecessary-parameter-property-assignment
5380
+ */
5381
+ 'ts/no-unnecessary-parameter-property-assignment'?: Linter.RuleEntry<[]>
5377
5382
  /**
5378
5383
  * Disallow unnecessary namespace qualifiers
5379
5384
  * @see https://typescript-eslint.io/rules/no-unnecessary-qualifier
@@ -12836,10 +12841,6 @@ type TsNoExtraneousClass = []|[{
12836
12841
  }]
12837
12842
  // ----- ts/no-floating-promises -----
12838
12843
  type TsNoFloatingPromises = []|[{
12839
-
12840
- ignoreVoid?: boolean
12841
-
12842
- ignoreIIFE?: boolean
12843
12844
  allowForKnownSafePromises?: (string | {
12844
12845
  from: "file"
12845
12846
  name: (string | [string, ...(string)[]])
@@ -12864,6 +12865,12 @@ type TsNoFloatingPromises = []|[{
12864
12865
  name: (string | [string, ...(string)[]])
12865
12866
  package: string
12866
12867
  })[]
12868
+
12869
+ checkThenables?: boolean
12870
+
12871
+ ignoreVoid?: boolean
12872
+
12873
+ ignoreIIFE?: boolean
12867
12874
  }]
12868
12875
  // ----- ts/no-inferrable-types -----
12869
12876
  type TsNoInferrableTypes = []|[{
@@ -13218,7 +13225,7 @@ type TsRestrictTemplateExpressions = []|[{
13218
13225
  allowNever?: boolean
13219
13226
  }]
13220
13227
  // ----- ts/return-await -----
13221
- type TsReturnAwait = []|[("in-try-catch" | "always" | "never")]
13228
+ type TsReturnAwait = []|[("in-try-catch" | "always" | "never" | "error-handling-correctness-only")]
13222
13229
  // ----- ts/sort-type-constituents -----
13223
13230
  type TsSortTypeConstituents = []|[{
13224
13231
 
package/dist/index.d.ts CHANGED
@@ -5374,6 +5374,11 @@ interface RuleOptions {
5374
5374
  * @see https://typescript-eslint.io/rules/no-unnecessary-condition
5375
5375
  */
5376
5376
  'ts/no-unnecessary-condition'?: Linter.RuleEntry<TsNoUnnecessaryCondition>
5377
+ /**
5378
+ * Disallow unnecessary assignment of constructor property parameter
5379
+ * @see https://typescript-eslint.io/rules/no-unnecessary-parameter-property-assignment
5380
+ */
5381
+ 'ts/no-unnecessary-parameter-property-assignment'?: Linter.RuleEntry<[]>
5377
5382
  /**
5378
5383
  * Disallow unnecessary namespace qualifiers
5379
5384
  * @see https://typescript-eslint.io/rules/no-unnecessary-qualifier
@@ -12836,10 +12841,6 @@ type TsNoExtraneousClass = []|[{
12836
12841
  }]
12837
12842
  // ----- ts/no-floating-promises -----
12838
12843
  type TsNoFloatingPromises = []|[{
12839
-
12840
- ignoreVoid?: boolean
12841
-
12842
- ignoreIIFE?: boolean
12843
12844
  allowForKnownSafePromises?: (string | {
12844
12845
  from: "file"
12845
12846
  name: (string | [string, ...(string)[]])
@@ -12864,6 +12865,12 @@ type TsNoFloatingPromises = []|[{
12864
12865
  name: (string | [string, ...(string)[]])
12865
12866
  package: string
12866
12867
  })[]
12868
+
12869
+ checkThenables?: boolean
12870
+
12871
+ ignoreVoid?: boolean
12872
+
12873
+ ignoreIIFE?: boolean
12867
12874
  }]
12868
12875
  // ----- ts/no-inferrable-types -----
12869
12876
  type TsNoInferrableTypes = []|[{
@@ -13218,7 +13225,7 @@ type TsRestrictTemplateExpressions = []|[{
13218
13225
  allowNever?: boolean
13219
13226
  }]
13220
13227
  // ----- ts/return-await -----
13221
- type TsReturnAwait = []|[("in-try-catch" | "always" | "never")]
13228
+ type TsReturnAwait = []|[("in-try-catch" | "always" | "never" | "error-handling-correctness-only")]
13222
13229
  // ----- ts/sort-type-constituents -----
13223
13230
  type TsSortTypeConstituents = []|[{
13224
13231
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@antfu/eslint-config",
3
3
  "type": "module",
4
- "version": "2.24.0",
4
+ "version": "2.24.1",
5
5
  "description": "Anthony's ESLint config",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
7
7
  "license": "MIT",
@@ -83,9 +83,9 @@
83
83
  "dependencies": {
84
84
  "@antfu/install-pkg": "^0.3.3",
85
85
  "@clack/prompts": "^0.7.0",
86
- "@stylistic/eslint-plugin": "^2.6.0-beta.1",
87
- "@typescript-eslint/eslint-plugin": "8.0.0-alpha.40",
88
- "@typescript-eslint/parser": "8.0.0-alpha.40",
86
+ "@stylistic/eslint-plugin": "^2.6.0",
87
+ "@typescript-eslint/eslint-plugin": "^8.0.0",
88
+ "@typescript-eslint/parser": "^8.0.0",
89
89
  "eslint-config-flat-gitignore": "^0.1.8",
90
90
  "eslint-flat-config-utils": "^0.3.0",
91
91
  "eslint-merge-processors": "^0.1.0",
@@ -93,7 +93,7 @@
93
93
  "eslint-plugin-command": "^0.2.3",
94
94
  "eslint-plugin-eslint-comments": "^3.2.0",
95
95
  "eslint-plugin-import-x": "^3.1.0",
96
- "eslint-plugin-jsdoc": "^48.8.3",
96
+ "eslint-plugin-jsdoc": "^48.10.2",
97
97
  "eslint-plugin-jsonc": "^2.16.0",
98
98
  "eslint-plugin-markdown": "^5.1.0",
99
99
  "eslint-plugin-n": "^17.10.1",
@@ -119,16 +119,16 @@
119
119
  },
120
120
  "devDependencies": {
121
121
  "@antfu/ni": "^0.22.0",
122
- "@eslint-react/eslint-plugin": "^1.6.0",
122
+ "@eslint-react/eslint-plugin": "^1.7.1",
123
123
  "@eslint/config-inspector": "^0.5.2",
124
124
  "@prettier/plugin-xml": "^3.4.1",
125
- "@stylistic/eslint-plugin-migrate": "^2.4.0",
125
+ "@stylistic/eslint-plugin-migrate": "^2.6.0",
126
126
  "@types/eslint": "^9.6.0",
127
127
  "@types/fs-extra": "^11.0.4",
128
- "@types/node": "^20.14.12",
128
+ "@types/node": "^22.0.2",
129
129
  "@types/prompts": "^2.4.9",
130
130
  "@types/yargs": "^17.0.32",
131
- "@unocss/eslint-plugin": "^0.61.6",
131
+ "@unocss/eslint-plugin": "^0.61.9",
132
132
  "astro-eslint-parser": "^1.0.2",
133
133
  "bumpp": "^9.4.1",
134
134
  "eslint": "npm:eslint-ts-patch@9.5.0-0",
@@ -152,14 +152,14 @@
152
152
  "svelte": "^4.2.18",
153
153
  "svelte-eslint-parser": "^0.41.0",
154
154
  "tsup": "^8.2.3",
155
- "tsx": "^4.16.2",
155
+ "tsx": "^4.16.3",
156
156
  "typescript": "^5.5.4",
157
- "vitest": "^2.0.4",
158
- "vue": "^3.4.34",
159
- "@antfu/eslint-config": "2.24.0"
157
+ "vitest": "^2.0.5",
158
+ "vue": "^3.4.35",
159
+ "@antfu/eslint-config": "2.24.1"
160
160
  },
161
161
  "resolutions": {
162
- "tsx": "~4.16.2"
162
+ "tsx": "~4.16.3"
163
163
  },
164
164
  "simple-git-hooks": {
165
165
  "pre-commit": "npx lint-staged"