eslint的自动修复无效

时间:2019-05-17 06:47:04

标签: eslint vue-cli-3

我配置了不允许使用分号的规则,但是`eslint-fix'不能自动修复吗?

  "eslintConfig": {
    "root": true,
    "env": {
      "node": true
    },
    "extends": [
      "plugin:vue/essential",
      "@vue/prettier"
    ],
    "rules": {
      "semi": ["error", "never"]
    },
    "parserOptions": {
      "parser": "babel-eslint"
    }
  }

控制台输出:

PS D:\web\items\cnode-m> npx eslint --fix .\src\main.js

D:\web\items\cnode-m\src\main.js
   1:22  error  Extra semicolon  semi
   2:28  error  Extra semicolon  semi
   3:30  error  Extra semicolon  semi
   4:28  error  Extra semicolon  semi
   6:33  error  Extra semicolon  semi
  12:18  error  Extra semicolon  semi

✖ 6 problems (6 errors, 0 warnings)
  6 errors and 0 warnings potentially fixable with the `--fix` option.

1 个答案:

答案 0 :(得分:0)

我找到了原因。是@vue/prettier。我将其卸载并替换为@vue/standard'.