Skip to content

Commit a98ccc8

Browse files
committedJan 22, 2025
feat: change editor rules from disable to non-fixable
1 parent d3a1022 commit a98ccc8

File tree

6 files changed

+395
-355
lines changed

6 files changed

+395
-355
lines changed
 

‎README.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -730,13 +730,15 @@ export default antfu({
730730

731731
### Editor Specific Disables
732732

733-
Some rules are disabled when inside ESLint IDE integrations, namely:
733+
Auto-fixing for the following rules are disabled when ESLint is running in a code editor:
734734

735735
- [`prefer-const`](https://eslint.org/docs/rules/prefer-const)
736-
- [`unused-imports/no-unused-imports`](https://www.npmjs.com/package/eslint-plugin-unused-imports)
737736
- [`test/no-only-tests`](https://github.com/levibuzolic/eslint-plugin-no-only-tests)
737+
- [`unused-imports/no-unused-imports`](https://www.npmjs.com/package/eslint-plugin-unused-imports)
738+
739+
Since v3.16.0, they are no longer disabled, but made non-fixable using [this helper](https://github.com/antfu/eslint-flat-config-utils#composerdisablerulesfix).
738740

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:
741+
This is to prevent unused imports from getting removed by the editor 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:
740742

741743
```js
742744
// eslint.config.js

‎package.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@
101101
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
102102
"@eslint/markdown": "^6.2.1",
103103
"@stylistic/eslint-plugin": "^2.13.0",
104-
"@typescript-eslint/eslint-plugin": "^8.20.0",
105-
"@typescript-eslint/parser": "^8.20.0",
104+
"@typescript-eslint/eslint-plugin": "^8.21.0",
105+
"@typescript-eslint/parser": "^8.21.0",
106106
"@vitest/eslint-plugin": "^1.1.25",
107107
"eslint-config-flat-gitignore": "^1.0.0",
108-
"eslint-flat-config-utils": "^1.0.0",
108+
"eslint-flat-config-utils": "^1.1.0",
109109
"eslint-merge-processors": "^1.0.0",
110110
"eslint-plugin-antfu": "^2.7.0",
111111
"eslint-plugin-command": "^2.1.0",
@@ -114,7 +114,7 @@
114114
"eslint-plugin-jsonc": "^2.18.2",
115115
"eslint-plugin-n": "^17.15.1",
116116
"eslint-plugin-no-only-tests": "^3.3.0",
117-
"eslint-plugin-perfectionist": "^4.6.0",
117+
"eslint-plugin-perfectionist": "^4.7.0",
118118
"eslint-plugin-regexp": "^2.7.0",
119119
"eslint-plugin-toml": "^0.12.0",
120120
"eslint-plugin-unicorn": "^56.0.1",
@@ -135,15 +135,15 @@
135135
"devDependencies": {
136136
"@antfu/eslint-config": "workspace:*",
137137
"@antfu/ni": "^23.2.0",
138-
"@eslint-react/eslint-plugin": "^1.23.2",
138+
"@eslint-react/eslint-plugin": "^1.24.1",
139139
"@eslint/config-inspector": "^1.0.0",
140140
"@prettier/plugin-xml": "^3.4.1",
141141
"@stylistic/eslint-plugin-migrate": "^2.13.0",
142142
"@types/fs-extra": "^11.0.4",
143143
"@types/node": "^22.10.7",
144144
"@types/prompts": "^2.4.9",
145145
"@types/yargs": "^17.0.33",
146-
"@unocss/eslint-plugin": "^65.4.2",
146+
"@unocss/eslint-plugin": "^65.4.3",
147147
"astro-eslint-parser": "^1.1.0",
148148
"bumpp": "^9.10.1",
149149
"eslint": "^9.18.0",
@@ -163,17 +163,17 @@
163163
"prettier-plugin-slidev": "^1.0.5",
164164
"rimraf": "^6.0.1",
165165
"simple-git-hooks": "^2.11.1",
166-
"svelte": "^5.19.0",
166+
"svelte": "^5.19.1",
167167
"svelte-eslint-parser": "^0.43.0",
168168
"tsup": "^8.3.5",
169169
"tsx": "^4.19.2",
170170
"typescript": "^5.7.3",
171-
"vitest": "^3.0.2",
171+
"vitest": "^3.0.3",
172172
"vue": "^3.5.13"
173173
},
174174
"resolutions": {
175175
"@eslint-community/eslint-utils": "^4.4.1",
176-
"@typescript-eslint/utils": "^8.20.0",
176+
"@typescript-eslint/utils": "^8.21.0",
177177
"eslint": "^9.18.0",
178178
"tsx": "^4.19.2"
179179
},

0 commit comments

Comments
 (0)
Please sign in to comment.