WebStorm eslint插件报错解决 - TypeError: this.CliEngine is not a constructor

将eslint更新版本后,出现TypeError: this.CliEngine is not a constructor的错误。

解决办法:

1.编辑 X:\WebStorm\plugins\JavaScriptLanguage\languageService\eslint\bin\eslint-plugin.js

2.找到以下片段

if (this.initError == null) {
    this.linter = require(this.basicPath + "lib/cli.js");
    this.options = require(this.basicPath + "lib/options");
    this.CliEngine = require(this.basicPath + "lib/cli-engine").CLIEngine;
}

加上标红部分即可。

posted @ 2019-11-14 10:11  Gugia桑  阅读(12802)  评论(1编辑  收藏  举报