Reputation: 31
I'm working on a project using the following:
When developing, I frequently get ESLint errors they stop my project from compiling. I run my project using make run
, which just calls yarn start
. I wanted to create a new make command that lets me run my project while setting all ESLint errors to warnings.
Luckily, Create React App seems to have something for this exact setting, an env variable called ESLINT_NO_DEV_ERRORS
. I created a .env
file in my root directory, and set ESLINT_NO_DEV_ERRORS=true
in that file.
However, when I do make run
aka yarn start
, it completely ignores that flag and still raises errors. To debug, I printed the env variables in public/index.html
. My custom env variable was set, but the ESLINT_NO DEV_ERRORS
was not (screenshot attached). The documentation says that it does not need to be prefixed with REACT_APP_
like other custom environment variables.
Any ideas or suggestions?
Upvotes: 3
Views: 3643
Reputation: 1812
Could also try using
TSC_COMPILE_ON_ERROR=true
DISABLE_ESLINT_PLUGIN=true
https://create-react-app.dev/docs/advanced-configuration/
However, depending on your dependency version, there might be a bug where some of the environment variables are ignored. You could try downgrading create-react-app
to <4.0.
Read through this issue for the full context, https://github.com/facebook/create-react-app/issues/9887.
Upvotes: 2