directory-named-webpack-plugin icon indicating copy to clipboard operation
directory-named-webpack-plugin copied to clipboard

Is there an eslint rule I can enable to behave like this?

Open nuclearspike opened this issue 6 years ago • 4 comments

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?

nuclearspike avatar Jan 17 '18 01:01 nuclearspike

Not that I know of, sorry

shaketbaby avatar Jan 19 '18 03:01 shaketbaby

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

mkg0 avatar Jan 19 '18 09:01 mkg0

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!

martin-eq avatar Oct 26 '18 04:10 martin-eq

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

livathos avatar May 23 '21 12:05 livathos