eslint命令在CI Server上失败,错误为“ ESLint找不到要从其扩展的配置”标准”

时间:2019-11-19 10:30:41

标签: node.js typescript eslint

我有eslint配置,可以在我的本地设置(使用vscode编辑器)上正常工作。

但是在CI Server上,它失败并显示以下错误:

  eslint:config-array-factory Config file found: /home/worker/workspace/-CI-CD-Pipeline-Node-Ts_DC-705/.eslintrc.json +0ms
  eslint:config-array-factory Loading {extends:"standard"} relative to /home/worker/workspace/-CI-CD-Pipeline-Node-Ts_DC-705/.eslintrc.json +1ms

Oops! Something went wrong! :(

ESLint: 6.6.0.

ESLint couldn't find the config "standard" to extend from. Please check that the name of the config is correct.

The config "standard" was referenced from the config file in "/home/worker/workspace/-CI-CD-Pipeline-Node-Ts_DC-705/.eslintrc.json".

If you still have problems, please stop by https://gitter.im/eslint/eslint to chat with the team.

我正在运行以下命令以完成测试:

./node_modules/.bin/eslint ./ --ext .ts

我看到git与此相关的多个问题(https://github.com/microsoft/vscode-eslint/issues/696),但没有一个解决方案或对我没有帮助。

任何人都可以在这里帮助我。

1 个答案:

答案 0 :(得分:1)

似乎没有安装 eslint-config-standard-with-typescript。

试试这个:

npm install --save-dev eslint@7 eslint-plugin-promise@4 eslint-plugin-import@2 eslint-plugin-node@11 @typescript-eslint/eslint-plugin@4 eslint-config-standard-with-typescript