Registry / testing / eslint-plugin-storybook

eslint-plugin-storybook

JSON →
library10.3.5jsnpmunverified

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.

npm install eslint-plugin-storybook
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-STOR
E
eslint-plugin-storybook
testingjavascriptv10.3.5
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

plugin
import plugin from 'eslint-plugin-storybook'
const plugin = require('eslint-plugin-storybook')
Package exports a default plugin object. In CJS, use require().default or the module directly.
rules
import { rules } from 'eslint-plugin-storybook'
Named export for accessing individual rule definitions if needed.
configs
import { configs } from 'eslint-plugin-storybook'
Predefined configs: 'recommended', 'addon-interactions', 'csf-strict'. Access via configs.recommended etc.

Configures the plugin with recommended rules via the prefixed config name.

// .eslintrc.cjs module.exports = { extends: ['plugin:storybook/recommended'], plugins: ['storybook'], rules: { 'storybook/story-exports': 'error', 'storybook/default-exports': 'error', 'storybook/hierarchy-separator': 'warn', 'storybook/no-title-property-in-meta': 'warn', 'storybook/no-stories-of': 'error', 'storybook/use-storybook-testing-library': 'warn', }, };
Debug
Known issues
deprecatedRule 'component-name-default-exports' has been renamed to 'default-exports'.
fix
Use 'storybook/default-exports' instead.
affects: >=8.0.0
breakingESLint 9 flat config support requires using the 'configs' export.
fix
Use import plugin from 'eslint-plugin-storybook'; export default [...plugin.configs.recommended];
affects: >=9.0.0
gotchaThe 'story-exports' rule requires that each story file has a default export. For CSF3 files with only meta, disable or adjust.
fix
Add default export or disable rule for test files: 'storybook/story-exports': 'off'.
affects: >=0.1.0
Errors
Common errors & fixes
Cannot find module 'eslint-plugin-storybook'
Package not installed or wrong version.
fix
npm install --save-dev eslint-plugin-storybook
ESLint Error: Configuration for rule 'storybook/story-exports' is invalid
Rule is not configured or plugin is not loaded.
fix
Add 'plugins: ["storybook"]' to your ESLint config.
TypeError: plugin.configs.recommended is not iterable
Using flat config with an older version of the plugin.
fix
Upgrade eslint-plugin-storybook to >=0.9.0 which supports flat config.
Upgrade
Version history
10.3.5latest on npm
Audit
Dependencies
eslintrequiredcore peer dependency required for ESLint plugin functionality
storybookrequiredpeer dependency for version alignment with Storybook
Agent activity
7 hits · last 30 days
node
6
Bingbot
1
Resources
eslint-plugin-storybook — npm install eslint-plugin-storybook · libregistry