directory-named-webpack-plugin
directory-named-webpack-plugin copied to clipboard
Is there an eslint rule I can enable to behave like this?
I like this plugin, but the issue is I have to shut off some eslint rules or my IDE complains the files don't exist since it's altering valid import rules. Is there an eslint plugin that allows my code to still be checked for valid imports but with similar options?
Not that I know of, sorry
If you change resolver behavior completely to webpack resolver
, eslint shouldn't throw any error.
you can try this https://www.npmjs.com/package/eslint-import-resolver-webpack
Tried to use eslint-import-resolver-webpack
but it doesn't work for me using Webpack 4.23.1 and ESLint 5.7.0. Does it work for you @mkg0?
EDIT:
Nevermind, there was a configuration issue in my webpack.config.js
that was breaking eslint.
I'm exporting a function to get access to env
and argv
parameters but eslint-import-resolver-webpack
doesn't pass that argument to Webpack:
module.exports = (env, argv) => {
[...]
return config;
}
Works properly with eslint-import-resolver-webpack
!
In my case eslint-import-resolver-webpack didn't help me because in my project webpack configuration returns Promise. So I made eslint package which solve this problem and it works fine for me. Package support aliases. If anyone is interested, the package is available here: https://www.npmjs.com/package/eslint-import-resolver-directory-named