{"id":19949,"library":"eslint-plugin-storybook","title":"eslint-plugin-storybook","description":"ESLint plugin providing best-practice rules for writing Storybook stories. Current stable version is 10.3.5, released as part of the Storybook monorepo. The plugin helps enforce conventions like story/component name matching (story-exports), default export structure (default-exports), and hierarchy customization (hierarchy-separator). It is actively maintained alongside Storybook itself, with frequent alpha releases. Key differentiators: first-party support directly from Storybook maintainers, automatic rule suggestions, and integration with Storybook's CSF (Component Story Format). Alternative: community plugins like eslint-plugin-stories exist but are less comprehensive.","status":"active","version":"10.3.5","language":"javascript","source_language":"en","source_url":"https://github.com/storybookjs/storybook","tags":["javascript","eslint","eslintplugin","eslint-plugin","storybook"],"install":[{"cmd":"npm install eslint-plugin-storybook","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-storybook","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-storybook","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"core peer dependency required for ESLint plugin functionality","package":"eslint","optional":false},{"reason":"peer dependency for version alignment with Storybook","package":"storybook","optional":false}],"imports":[{"note":"Package exports a default plugin object. In CJS, use require().default or the module directly.","wrong":"const plugin = require('eslint-plugin-storybook')","symbol":"plugin","correct":"import plugin from 'eslint-plugin-storybook'"},{"note":"Named export for accessing individual rule definitions if needed.","wrong":"","symbol":"rules","correct":"import { rules } from 'eslint-plugin-storybook'"},{"note":"Predefined configs: 'recommended', 'addon-interactions', 'csf-strict'. Access via configs.recommended etc.","wrong":"","symbol":"configs","correct":"import { configs } from 'eslint-plugin-storybook'"}],"quickstart":{"code":"// .eslintrc.cjs\nmodule.exports = {\n  extends: ['plugin:storybook/recommended'],\n  plugins: ['storybook'],\n  rules: {\n    'storybook/story-exports': 'error',\n    'storybook/default-exports': 'error',\n    'storybook/hierarchy-separator': 'warn',\n    'storybook/no-title-property-in-meta': 'warn',\n    'storybook/no-stories-of': 'error',\n    'storybook/use-storybook-testing-library': 'warn',\n  },\n};","lang":"javascript","description":"Configures the plugin with recommended rules via the prefixed config name."},"warnings":[{"fix":"Use 'storybook/default-exports' instead.","message":"Rule 'component-name-default-exports' has been renamed to 'default-exports'.","severity":"deprecated","affected_versions":">=8.0.0"},{"fix":"Use import plugin from 'eslint-plugin-storybook'; export default [...plugin.configs.recommended];","message":"ESLint 9 flat config support requires using the 'configs' export.","severity":"breaking","affected_versions":">=9.0.0"},{"fix":"Add default export or disable rule for test files: 'storybook/story-exports': 'off'.","message":"The 'story-exports' rule requires that each story file has a default export. For CSF3 files with only meta, disable or adjust.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install --save-dev eslint-plugin-storybook","cause":"Package not installed or wrong version.","error":"Cannot find module 'eslint-plugin-storybook'"},{"fix":"Add 'plugins: [\"storybook\"]' to your ESLint config.","cause":"Rule is not configured or plugin is not loaded.","error":"ESLint Error: Configuration for rule 'storybook/story-exports' is invalid"},{"fix":"Upgrade eslint-plugin-storybook to >=0.9.0 which supports flat config.","cause":"Using flat config with an older version of the plugin.","error":"TypeError: plugin.configs.recommended is not iterable"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}