Included in these configurations:
- recommended
- flat/recommended
- csf
- flat/csf
In CSF, a story file should contain a default export that describes the component, and at named exports that describe the stories. This rule enforces the definition of at least one named export in story files.
Examples of incorrect code for this rule:
export default {
title: 'Button',
args: { primary: true },
component: Button,
}
// no named export
Examples of correct code for this rule:
export default {
title: 'Button',
args: { primary: true },
component: Button,
}
export const Primary = {} // at least one named export!
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.
More information about defining stories here: https://storybook.js.org/docs/react/writing-stories/introduction#defining-stories