I've recently created a project with create-react-project
.
The problem is that, while I'm developing, every time there's a problem with ESLint, the build breaks and doesn't compile the code.
Can I keep the build running while still having ESLint running and reporting errors that I will fix later?
Basically, just delete . eslintrc and any other eslint config files(if any) from the project. Also, check your package. json and delete all eslint packages and do npm install on your project.
Note, ESLint is installed with create-react-app, so you don't need to explicitly install it. Then install the packages for Airbnb config. This command will work for Yarn or NPM.
Because Create React App comes with ESLint already integrated. They use their own sharable ESLint configuration and this can be found under the eslintConfig object in package.
If you want to force ESLint to always emit warnings (that will not stop you build) instead of errors, you need to set emitWarning: true
:
{
enforce: 'pre',
include: paths.appSrc,
test: /\.(js|jsx|mjs)$/,
use: [{
loader: require.resolve('eslint-loader'),
options: {
formatter: eslintFormatter,
eslintPath: require.resolve('eslint'),
emitWarning: true, 👈 HERE
},
}],
},
As stated in the docs:
Errors and Warning
By default the loader will auto adjust error reporting depending on eslint errors/warnings counts. You can still force this behavior by using
emitError
oremitWarning
options:
emitError
(default:false
)Loader will always return errors if this option is set to true.
emitWarning
(default:false
)Loader will always return warnings if option is set to
true
. If you're using hot module replacement, you may wish to enable this in development, or else updates will be skipped when there's an eslint error....
just add DISABLE_ESLINT_PLUGIN=true
in your .env
file
cheers !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With