Included in these configurations:
- csf
- flat/csf
- recommended
- flat/recommended
In CSF, a story file should contain a default export that describes the component, and named exports that describe the stories. This rule enforces the definition of a default export in story files.
Examples of incorrect code for this rule:
// no default export
export const Primary = {}
Examples of correct code for this rule:
export default {
title: 'Button',
args: { primary: true },
component: Button,
}
export const Primary = {}
This rule should only be applied in your .stories.*
files. Please ensure you are defining the storybook rules only for story files. You can see more details here.
If you're using Storybook 6.5 and CSF in MDX, you should disable this rule for the stories that use CSF in MDX. You can see how to override the rule here.
More information about defining stories here: https://storybook.js.org/docs/react/writing-stories/introduction#defining-stories