Ignore or prevent ESLint errors from breaking the build in a React project (create-react-project)

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 or emitWarning 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.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)