-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds ability to support array of alias values. #14
base: master
Are you sure you want to change the base?
Conversation
@johvin any chance we can take a look at this PR? I could make use of it :) |
@DanHulton, any chance of releasing this fork as a different NPM package? (if u didn't do it already) |
I may have to. I've been using a link directly to my branch in git ( |
I started doing the same today 🙊 |
For now, I have published my fork of this package as eslint-import-resolver-alias-array to make it easier for people to use this code. I'll happily deprecate it once this PR is resolved. |
why not accept this pr,it's very useful! |
I would like to add that I am also using this PR in the form the |
As of webpack 5, aliases can have an array of potential resolution paths, with the first entry in the array that resolves successfully being used. This allows users to define "fallback" paths to check.
However, this then breaks eslint, since it doesn't know what to do with a map, and simply picking one path or the other to default to could break under certain circumstances.
This patch allows aliases to have an array as their second parameter, which behave the same way that array paths in webpack do.