要么我还不完全理解 node dependencies%中的dependenciesdevDependencies,要么eslint在这里就错了(无法正确分析):

   3:1   error  'chai' should be listed in the project's dependencies, not devDependencies              import/no-extraneous-dependencies
   4:1   error  'chai-enzyme' should be listed in the project's dependencies, not devDependencies       import/no-extraneous-dependencies
   5:1   error  'enzyme' should be listed in the project's dependencies, not devDependencies            import/no-extraneous-dependencies
   7:1   error  'sinon' should be listed in the project's dependencies, not devDependencies             import/no-extraneous-dependencies
   9:1   error  'redux-mock-store' should be listed in the project's dependencies, not devDependencies  import/no-extraneous-dependencies

这些都是测试依赖项,为什么说它们应该列在dependencies中?

附加说明:我们使用Travis作为我们的CI,所以我也不知道这是否有任何不同.

推荐答案

通过将此添加到我的.eslintrc:

"import/no-extraneous-dependencies": ["error", {"devDependencies": true}]

[no-extraneous-dependencies] Add exceptions? #422

Based on this user's reply:

您可以在中设置选项devdependences:true.在你的

规则:导入/无无关依赖项:[错误,{devdependences:

我想这可能对你有用?这就是我将如何使用规则,在

Also this post was helpful to confirm I wasn't insane to not want some of these in my dependencies list: Sharable ESLint Config

Node.js相关问答推荐

无法在我的 node 项目中转让Google Drive v3 API中的所有权

如何在Node js中从MongoDB获取特定数据,使用GET方法?

如何使用多个OR参数从多个集合聚合

Firebase-admin筛选器.或只考虑第一个WHERE子句

在Android Studio中react 本机构建失败:未正确检测到Node.js版本

如何呈现ejs.renderFile中包含的子模板?

创建查询以展开数组并筛选出具有特定值的元素之后的元素

如何使用 Remix 仅在客户端呈现组件?

npm chokidar 触发事件两次

在 Atlas 触发器(Node JS)中正确初始化 Firebase 管理 SDK

Sharp JS 依赖关系 destruct 了 Elastic Beanstalk 上的 Express Server

即使部署成功,也不会触发 Firebase 函数来填充 Firestore 集合.为什么?

在 ExpressJS 中将变量传递给 JavaScript

如何使用适用于 Node.js 的 AWS 开发工具包将 Amazon S3 中的所有对象从一个前缀复制/移动到另一个前缀

代理后面的凉亭

webpack css-loader 在外部样式表的 url() 引用中找不到图像

如何从 npm 注册表中删除 npm 包?

nodejs - 如何读取和输出 jpg 图像?

在 Node.js 中写入 CSV

如何在 node.js 沙箱中安全地运行用户提交的脚本?