Eslint rules for Storybook Best Practices
You'll first need to install ESLint:
$ npm i eslint --save-dev
Next, install eslint-plugin-storybook
:
$ npm install eslint-plugin-storybook --save-dev
Add storybook
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"storybook"
]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"storybook/prefer-csf": "error"
}
}
- prefer-csf: Display lint message when storiesOf API is used instead of the Component Story Format