ESLint自动修复忽略规则

问题描述 投票:5回答:1

我在vscode中使用ESLint和选项"eslint.autoFixOnSave": true

基本上,我想:

  1. 忽略1个特定的修复规则:prefer-const
  2. 查看编辑器中突出显示的所有警告和错误(包括prefer-const
visual-studio-code eslint
1个回答
0
投票

似乎有一个新的插件:eslint-plugin-no-autofix

{
  "plugins": ["no-autofix"],
  "rules": {
    "prefer-const": "off",
    "no-autofix/prefer-const": "warn",
  }
}
© www.soinside.com 2019 - 2024. All rights reserved.