-
Notifications
You must be signed in to change notification settings - Fork 55
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
eslint: add rule to detect erroneous external imports #961
Conversation
Azure Static Web Apps: Your stage site is ready! Visit it here: https://ambitious-stone-0033b3603-961.westeurope.1.azurestaticapps.net |
Azure Static Web Apps: Your stage site is ready! Visit it here: https://ambitious-stone-0033b3603-961.westeurope.1.azurestaticapps.net |
Azure Static Web Apps: Your stage site is ready! Visit it here: https://ambitious-stone-0033b3603-961.westeurope.1.azurestaticapps.net |
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.
Really great to get this rule in place! You found some weird imports here an there.
I only have one request regarding the rule name. It can be misunderstood because we call our own module "external".
Azure Static Web Apps: Your stage site is ready! Visit it here: https://ambitious-stone-0033b3603-961.westeurope.1.azurestaticapps.net |
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.
Looks good to me :-)
This new rule ensures that we won't accidentally make imports from external libraries elsewhere. The only allowed places to do so are in tests, stories, and
src/external/*
modules.We won't notice these errors in the dev-server, because Vite knows how to handle them, but it WILL become a problem in the compiled output used in the CMS.
BAD:
GOOD: