node.js - eslint 命令在 CI 服务器上失败,错误为 "ESLint couldn' t find the config "standard"to extend from"

标签 node.js typescript eslint

我有 eslint 配置,它在我的本地设置(使用 vscode 编辑器)上运行得非常好。

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

  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.

我正在运行以下命令来 lint:
./node_modules/.bin/eslint ./ --ext .ts
我看到 git 上有多个与此相关的问题( https://github.com/microsoft/vscode-eslint/issues/696 ),但没有解决方案或对我不起作用。

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

最佳答案

似乎没有安装 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

关于node.js - eslint 命令在 CI 服务器上失败,错误为 "ESLint couldn' t find the config "standard"to extend from",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58931905/

相关文章:

javascript - Express,用json创建cookie

javascript - Node js 路由不工作,总是显示无法发布

angularjs - 返回 promise 的 TypeScript 属性 - Get/Set 访问器必须具有相同的类型

typescript - 使用可选重载时的剩余参数

node.js - 在 reactjs 中使用 npm uuid

javascript - 如何使用 Knex.js 从列中检索唯一值?

node.js - Mongodb,查找集合是否为空,node.js

javascript - 你如何在 typescript 中声明一个对象数组?

npm - 如何在 VS Code 中设置 Airbnb ESLint?

reactjs - “Proptypes”未定义