webpack-contrib / eslint-loader

[DEPRECATED] A ESlint loader for webpack
MIT License
1.06k stars 121 forks source link

Running webpack when the entry is using require.context does not fail with proper exit code #305

Closed carlcodes closed 4 years ago

carlcodes commented 5 years ago

The state of my application (migrating from angularjs to react) requires a need for requiring all files in a directory, as apposed to using normal imports / requires / react dom / whatever else. e.g. https://stackoverflow.com/questions/29421409/how-to-load-all-files-in-a-directory-using-webpack-without-require-statements

Expected Behavior

When using require.context to require files, running yarn webpack should fail with exit code 2 if there are eslint errors.

Actual Behavior

the script shows the eslint errors but does not fail.

https://github.com/carlcodes/testcase-eslint-loader-requireAll

How Do We Reproduce?

pull down my above project, run yarn, run yarn webpack. if you toggle the commented out code in the entry file it works, but my setup needs it to work as is.

ricardogobbosouza commented 4 years ago

Hi @carlcodes Try to use eslint-webpack-plugin We are building this plugin to have more control than the loader