code/lib/eslint-plugin/docs/rules/no-renderer-packages.md
Included in these configurations: <ul><li>recommended</li><li>flat/recommended</li></ul>
<!-- RULE-CATEGORIES:END -->This rule prevents importing Storybook renderer packages directly into stories. Instead, use framework-specific packages designed for your build tool (e.g., Vite, Webpack).
The rule will suggest appropriate framework packages based on which renderer you're trying to use:
@storybook/html: Use @storybook/html-vite@storybook/preact: Use @storybook/preact-vite@storybook/react: Use @storybook/nextjs, @storybook/nextjs-vite, @storybook/react-vite, @storybook/react-webpack5, or @storybook/react-native-web-vite@storybook/server: Use @storybook/server-webpack5@storybook/svelte: Use @storybook/svelte-vite, or @storybook/sveltekit@storybook/vue3: Use @storybook/vue3-vite@storybook/web-components: Use @storybook/web-components-viteExamples of incorrect code for this rule:
// Don't import renderer packages directly
import { something } from "@storybook/react";
import { something } from "@storybook/vue3";
import { something } from "@storybook/web-components";
Examples of correct code for this rule:
// Do use the appropriate framework package for your build tool
import { something } from "@storybook/react-vite"; // For Vite
import { something } from "@storybook/vue3-vite"; // For Vite
import { something } from "@storybook/web-components-vite"; // For Vite
import { something } from "@storybook/nextjs"; // For Next.js
If you have a specific need to use renderer packages directly in your stories, you can turn off this rule. However, it's recommended to use the framework-specific packages as they are optimized for your build tool and provide better integration with your development environment.
For more information about Storybook's framework-specific packages and build tools, see: