Problem
Running npm run lint fails with:
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'eslint-plugin-storybook'
imported from eslint.config.js
eslint.config.js uses a static import for eslint-plugin-storybook. If the package isn't in node_modules, ESLint completely crashes — it can't even lint non-Storybook files.
Root Cause
eslint-plugin-storybook and other Storybook dependencies were added to package.json in commit dbed07d
- Developers who had
node_modules from before that commit never re-ran npm install
- Worktrees start with empty
node_modules, so they always hit this
- CI is unaffected (runs
npm ci which installs everything)
Fix
Make the Storybook ESLint plugin a graceful optional dependency using dynamic import() with a try/catch fallback. If the package isn't installed, ESLint should skip Storybook rules but still work for everything else.
Problem
Running
npm run lintfails with:eslint.config.jsuses a staticimportforeslint-plugin-storybook. If the package isn't innode_modules, ESLint completely crashes — it can't even lint non-Storybook files.Root Cause
eslint-plugin-storybookand other Storybook dependencies were added topackage.jsonin commitdbed07dnode_modulesfrom before that commit never re-rannpm installnode_modules, so they always hit thisnpm ciwhich installs everything)Fix
Make the Storybook ESLint plugin a graceful optional dependency using dynamic
import()with a try/catch fallback. If the package isn't installed, ESLint should skip Storybook rules but still work for everything else.