问题
I'm using ESLint in vscode with option "eslint.autoFixOnSave": true
.
Basically, I want:
- Ignore 1 particular rule for fixing: prefer-const
- See all the warnings and errors highlighted in editor (including
prefer-const
)
回答1:
There seems to be a new plugin: eslint-plugin-no-autofix
{
"plugins": ["no-autofix"],
"rules": {
"prefer-const": "off",
"no-autofix/prefer-const": "warn",
}
}
来源:https://stackoverflow.com/questions/45443478/eslint-autofix-ignore-rule