storybookjs / eslint-plugin-storybook

🎗Official ESLint plugin for Storybook
MIT License
238 stars 42 forks source link

storybook/no-uninstalled-addons false positives on monorepo #127

Open unional opened 1 year ago

unional commented 1 year ago

Describe the bug

Getting errors like these in a monorepo:

The @storybook/addon-links is not installed in pats/. Did you forget to install it or is your package.json in a different location?

the pats is the root of the monorepo. Each package has storybook and addons installed.

Expected behavior no error

Additional context I'm not sure if storybook should be hoisted or install only at the top level of monorepo.

Right now, I have each package self-contained and each has their own copy of storybook.

I'm using pnpm.

yannbf commented 1 year ago

Hey @unional thanks for opening this issue. Would you be able to either provide a minimal reproduction repo or a PR to fix this issue? This is the rule code: https://github.com/storybookjs/eslint-plugin-storybook/blob/main/lib/rules/no-uninstalled-addons.ts

You could for now disable that rule to unblock you.

barrymichaeldoyle commented 1 year ago

@yannbf this isn't exactly a fix but it looks like a work around has been implemented here that is better than just blanket ignoring the rule:

https://github.com/storybookjs/eslint-plugin-storybook/pull/129

clarkd commented 7 months ago

We have the same issue here - also using pnpm with a monorepo.