-
Notifications
You must be signed in to change notification settings - Fork 205
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
feat(root): add glob support #78
Conversation
Current coverage is 98.43% (diff: 100%)
|
Thanks @MoeSattler, this is great. We could create the glob at that time so it can be reused for every import/require in the file. Also, I'd like your thought on that, but if there're multiple files with the same name in multiple /components, should the plugin warn there's a conflict? Like |
@tleunen Do we have access to the |
Don't remember what we have access to :/ |
@tleunen for now I settled with
Good question. |
The glob operation seems to take too long on CI btw, you are using arrow functions for tests, which is discouraged: |
@@ -1,25 +1,29 @@ | |||
/* eslint-env mocha */ | |||
/* eslint-disable prefer-arrow-callback */ | |||
/* eslint-disable func-names */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you just name the anonym fn with "test" instead? You should be able to remove these 2 eslint rules after that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It still would warn me prefer-arrow-callback
.
Also I'd need to give the upper scope functions (root
and alias
) different names to not trigger the no-shadow
rule.
Thanks for the great contribution @MoeSattler. |
You were of course right. Giving a proper test case removed the speed issue entirely. Still, while non-glob paths are not affected (people not using globs won't be able to tell the difference), glob lookups take some more time. |
Thanks for the contribution @MoeSattler. |
I added support for glob. It was a little tricky to integrate that into the current architecture without having the glob running on every
import
.For this reason I used a function with memoization.
Now we can do stuff like this:
and all
shared
folders are considered roots.This is useful in architectures like this.
Let me know what you think!