代码之家  ›  专栏  ›  技术社区  ›  Alex

ESLint自动修复忽略规则

  •  11
  • Alex  · 技术社区  · 9 年前

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

    基本上,我想要:

    1. 用于固定 : prefer-const
    2. 查看编辑器中突出显示的所有警告和错误(包括 prefer-const
    1 回复  |  直到 9 年前
        1
  •  8
  •   Alex    7 年前

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

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