continuous-integration - 在circleci中构建反应应用程序时如何使eslint工作?
问题描述
我在我的个人项目上配置 eslint 以允许console.log
成为警告而不是错误,因此在本地我的应用程序编译成功。
当我npm run build
在本地跑步时
Creating an optimized production build...
Compiled with warnings.
src/components/ReduxName/ReduxName.tsx
Line 12:3: Unexpected console statement no-console
Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.
这很好,一切正常。但是当我在circleci中跑步时
Creating an optimized production build...
Treating warnings as errors because process.env.CI = true.
Most CI servers set it automatically.
Failed to compile.
src/components/ReduxName/ReduxName.tsx
Line 12:3: Unexpected console statement no-console
好像 circleci 不认识我的 eslint 设置???知道如何度过这个难关吗?
解决方案
原来问题就在我眼前
Treating warnings as errors because process.env.CI = true.
Most CI servers set it automatically.
警告被视为 CI 上的错误,当然我的应用程序无法编译。我通过专门console.log
在 eslint 中不发出警告来修复它并解决了问题。
推荐阅读
- python - 如何在python的数据库中从编码的base64字符串显示解码的base64 pdf文件?
- velo - 如何在wix编辑器corvid中制作可导航的屏幕截图
- django - 使用 Django 创建同步(实时和离线)的最佳实践或模式是什么?
- c# - 如何在 ASP.NET MVC 中使用 C# 仅编辑数据库集合(azure Cosmosdb)中的必填字段
- java - Selenium Java 未找到下拉菜单元素
- r - 如何将插入符号训练的随机森林模型输入到 predict() 和 performance() 函数中?
- wordpress - 更改旧的 WordPress 图像目录
- python - Pygame-我收到一个错误:ValueError:表面区域外的次表面矩形。如何解决?
- r - 如何将超过某个点的列收集到行中
- sql - 在 PostgreSQL 回归套件中添加特定于语言环境的测试是个好主意吗?