Closed carlcodes closed 4 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
When using require.context to require files, running yarn webpack should fail with exit code 2 if there are eslint errors.
require.context
yarn webpack
the script shows the eslint errors but does not fail.
https://github.com/carlcodes/testcase-eslint-loader-requireAll
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.
yarn
Hi @carlcodes Try to use eslint-webpack-plugin We are building this plugin to have more control than the loader
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, runningyarn 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
, runyarn webpack
. if you toggle the commented out code in the entry file it works, but my setup needs it to work as is.