-
Notifications
You must be signed in to change notification settings - Fork 58
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
Add no-uninstalled-addons
rule
#95
Comments
Hey, I would like to pick that up! I think we can add a solution that handles both scenarios:
We will have to make some assumptions for the second case, such as the name of the addons we expect them to be (@storybook/addon or storybook-addon, for instance), but it's quite doable. |
Hey, after working through the feature, I noticed that it would be a bit too complicated to do the typo check properly. Since by checking if the plugin is installed would be already quite a benefit for every user and it would give a hint about a plugin with a typo, I left the typo check outside of this enhancement. |
Thanks a lot @andrelas1 you did an amazing job! Your work has been released in v0.6.0 |
Hi, Note that in some cases the rule breaks for no reason:
So I get:
Maybe just match a "start with"? Or check the underlying imported file exists? |
Is your feature request related to a problem? Please describe.
Whenever users register addons in main.js, there's a possibility of:
1 - having typos
2 - registering addons that are not installed (not in package.json)
In either scenario, the users get this current error when running Storybook, which is not helpful at all:
Describe the solution you'd like
There should be an eslint rule that warns users that addons were registered in main.js but they are not installed.
1 - Process main.js files
2 - Identify the
addons
field from it3 - Go through each addon and check whether they exist in
package.json
(Ideally read once and cached or something like that)4 - If the addon is not in package.json, report to users
Possible
Additional context
It's important to know the ways you can register an addon:
The text was updated successfully, but these errors were encountered: