eslint-webpack-plugin icon indicating copy to clipboard operation
eslint-webpack-plugin copied to clipboard

failOnError is not working in development mode

Open Mikilll94 opened this issue 3 years ago • 2 comments
trafficstars

Bug report

failOnError documentation is wrong. When there is an ESLint error, the build is failed but only in production mode. In development mode the build does not fail.

Actual Behavior

Build is not failing when mode is set to development.

Expected Behavior

The dist folder should not be generated in development mode or the docs should be updated.

How Do We Reproduce?

webpack-test.zip

  1. Run npm run build in the project above.
  2. As you can see there are ESLint errors but the dist folder is still generated.

Please paste the results of npx webpack-cli info here, and mention other relevant information

System:
    OS: Windows 10 10.0.19043
    CPU: (12) x64 AMD Ryzen 5 3600 6-Core Processor
    Memory: 10.31 GB / 15.91 GB
  Binaries:
    Node: 16.13.2 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.11 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.4.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (97.0.1072.76)     
    Internet Explorer: 11.0.19041.1202

Mikilll94 avatar Feb 02 '22 19:02 Mikilll94

Hi @Mikilll94 That's the goal, it just fails in production Probably the documentation is wrong Not sure if it's possible to stop compilation in development mode, is it @alexander-akait ?

ricardogobbosouza avatar Feb 24 '22 02:02 ricardogobbosouza

It is possible, but expected, because build failed due warnings/errors only in production, you can change it using webpack config.

alexander-akait avatar Feb 24 '22 10:02 alexander-akait

@alexander-akait can you provide anymore insight into what changes in the webpack config are needed to stop compilation on errors? I think this could be useful since it makes it obvious in development that you have an error

shanesc avatar Jan 06 '23 23:01 shanesc

This is expected by webpack...

Any error thrown in development mode the build does not break

Closing as it is not a question related to this plugin

ricardogobbosouza avatar Feb 03 '23 19:02 ricardogobbosouza