带--fix选项的ESLINT无法修复我的js文件

时间:2018-11-22 08:16:59

标签: node.js eslint

我的eslint配置很简单

{
  "extends": "airbnb-base",
  "env": {
    "browser": true,
    "es6": true,
    "jquery": true
  },
  "plugins": [
    "ejs"
  ]
}

我跑步时

eslint app.js 

输出为:

  162:110  error    A space is required after ','                                                                  comma-spacing
  167:1    error    Expected indentation of 2 spaces but found 4                                                   indent
  168:1    error    Expected indentation of 4 spaces but found 8                                                   indent
  169:1    error    Expected indentation of 4 spaces but found 8                                                   indent
  170:1    error    Expected indentation of 2 spaces but found 4                                                   indent
  171:1    error    Expected indentation of 4 spaces but found 8                                                   indent
  171:9    warning  Unexpected console statement                                                                   no-console
  172:1    error    Expected indentation of 4 spaces but found 8                                                   indent
  173:1    error    Expected indentation of 6 spaces but found 12                                                  indent
  174:1    error    Expected indentation of 6 spaces but found 12                                                  indent
  175:1    error    Expected indentation of 4 spaces but found 8                                                   indent
  176:11   error    Expected indentation of 2 spaces but found 4                                                   indent

✖ 131 problems (116 errors, 15 warnings)
  102 errors and 0 warnings potentially fixable with the `--fix` option.

它说用--fix可以修复102个错误,但是当我用eslint app.js --fix运行时,它什么也没解决。它显示相同的输出。为什么--fix无法修复任何内容?

更新

当我从插件中删除ejs时,它工作正常。但是,仍然不了解此问题的根本原因是什么。

0 个答案:

没有答案