ESLint autofix ignore rule

让人想犯罪 __ 提交于 2020-03-01 03:10:49

问题


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:


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!