I'm using ESLint in vscode with option "eslint.autoFixOnSave": true
.
Basically, I want:
prefer-const
)ESLint supports 2 mechanisms for ignoring rule violations in code: Using comments, which let you disable certain rules for a line or code block. Using the . eslintignore file.
You can tell ESLint to ignore specific files and directories using ignorePatterns in your config files. ignorePatterns patterns follow the same rules as . eslintignore .
If you have the ESLint extension installed you can use CTRL+SHIFT+P to open the Command Palette. Then search for ESLint: Fix all auto-fixable Problems and press ENTER (or RETURN ). You are free from counting indentation and checking for quotation marks and semicolons!
To enable running eslint --fix on save for the current project, go to Preferences / Settings | Languages and Frameworks | JavaScript | Code Quality Tools | ESLint and tick the Run eslint --fix on save checkbox. By default, WebStorm will run ESLint to autofix . js, .
There seems to be a new plugin: eslint-plugin-no-autofix
{
"plugins": ["no-autofix"],
"rules": {
"prefer-const": "off",
"no-autofix/prefer-const": "warn",
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With