Continuous integration 在circleci中构建react应用程序时,如何使eslint工作?
我在我的个人项目上配置了eslint,以允许Continuous integration 在circleci中构建react应用程序时,如何使eslint工作?,continuous-integration,create-react-app,eslint,circleci,Continuous Integration,Create React App,Eslint,Circleci,我在我的个人项目上配置了eslint,以允许console.log作为警告而不是错误,因此在本地我的应用程序上编译成功 当我在本地运行npm运行build时 Creating an optimized production build... Compiled with warnings. src/components/ReduxName/ReduxName.tsx Line 12:3: Unexpected console statement no-console Search fo
console.log
作为警告而不是错误,因此在本地我的应用程序上编译成功
当我在本地运行npm运行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中不是警告来修复它,并解决了问题