-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
eslint.codeActionsOnSave.mode
silently overrides eslint.codeActionsOnSave.rules
#1388
Comments
Thanks for reporting this. I will improve the documentation around this, but
This is not fully correct. If you use version >= 8 then the setting of |
This is not the behavior I'm observing. If |
You are correct (see vscode-eslint/server/src/eslintServer.ts Line 392 in 7568b4c
|
Actually above comment is wrong. The whole code creates a ESLint class as a default at the end. |
Looking at the code I do think I fixed this, but not yet available in a new version. Do you have a repro I can clone that demos what you are seeing to ensure it works now. |
Sure, I made a repo which demonstrates the issue clearly: I've tested this on a clean installation of VS Code v1.63.1 with no user settings, and vscode-eslint v2.2.2. If you open the project and save the file |
Using dbaeumer.vscode-eslint v2.2.2 w/ eslint v8.4.1
.vscode/settings.json:
.eslintrc.yaml:
package.json:
When saving a file all fixes are applied even though the rules are explicitly set to an empty array. It's ok that these two options are mutually exclusive but the interaction between them is surprising without any kind of runtime warning or documentation of this invariant.
Additionally the documentation around
eslint.codeActionsOnSave.rules
is a little confusing. It's stated "This setting is only honored if either ESLint version 8 or greater is used or ESLint version 7 is used and the setting eslint.useESLintClass is set to true." which I mentally parsed as:version >= 8 || (version == 7.x && useESLintClass)
. Consider: "This setting requires ESLint 7 or higher and that the eslint.useESLintClass option is enabled".The text was updated successfully, but these errors were encountered: