Closed
Description
openedon Sep 8, 2016
I'm porting a codebase to ES6. In some cases we explicitly want to use require()
, because import
must be at the top of the file.
For example, we sometimes write:
if (process.env.NODE_ENV == "production") {
require('../foo.css');
}
or in tests we sometimes want to only require things at certain points. We also conditionally require polyfills.
Could we add a configuration option to allow require()
inside no-commonjs
? Alternatively, would it make sense to split the rule into no-commonjs-require
and no-commonjs-exports
?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment