-
-
Notifications
You must be signed in to change notification settings - Fork 47
feat(allow-modules): include virtual:
in the modules pattern
#425
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
Conversation
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.
❤️
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.
Can you add some test cases to avoid possible future regressions?
I have never seen this before, what package manager uses virtual? |
Vite has a convention for them https://vite.dev/guide/api-plugin#virtual-modules-convention and there are frameworks and libraries taking advantage of this. One good example is Remix |
PR updated with test cases for Unsure why is now failing when running |
not related to the change - I'll try to fix it later. ❤️ |
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.
LGTM. Would like @scagood re-review before merging.
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.
Thanks for the info and link!
It would be good if we could add some tests for the other rules that use get-allow-modules
(I believe that no-missing-*
uses this too?
I swear I fixed those types errors! Sorry about them 😢
No worries about the types issues! I will write test for the other rules 👍 |
8cf2ef2
to
d979195
Compare
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.
Thank you 👍
Update Module Name Pattern to Support Virtual Modules
Description
• Modified the regular expression pattern in the schema definition to allow an optional "virtual:" prefix. This update enables the configuration to recognize virtual modules.
• The updated pattern now supports module identifiers that may start with "virtual:" followed by optionally scoped names and the module name (e.g., "virtual:@scope/module" or "virtual:module").
• Existing validation behavior is preserved for standard module names, ensuring backward compatibility.
• No changes were made to the core logic; only the schema pattern expression has been updated.