10
votes

I'm using ESLint in vscode with option "eslint.autoFixOnSave": true.

Basically, I want:

  1. Ignore 1 particular rule for fixing: prefer-const
  2. See all the warnings and errors highlighted in editor (including prefer-const)
1
Did you ever figure this out? I'm looking to do the same with the no-debugger rule. Hard to put breakpoints in my code if it auto removes debugger statements.Bradley
Nope. I guess I'm gonna wait for #7649. You can try this if you are using vscode.Alex

1 Answers

7
votes

There seems to be a new plugin: eslint-plugin-no-autofix

{
  "plugins": ["no-autofix"],
  "rules": {
    "prefer-const": "off",
    "no-autofix/prefer-const": "warn",
  }
}