diff --git a/rules/storybook.js b/rules/storybook.js new file mode 100644 index 0000000..c9726b8 --- /dev/null +++ b/rules/storybook.js @@ -0,0 +1,15 @@ +module.exports = { + plugins: ['storybook'], + extends: ['plugin:storybook/recommended'], + rules: { + // `storiesOf` is deprecated and should not be used + // https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/no-stories-of.md + // Since Storybook 5.2, the CSF format was introduced and the storiesOf API has been deprecated. + 'storybook/no-stories-of': 'error', + + // Do not define a title in meta + // https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/no-title-property-in-meta.md + // Starting in CSF 3.0, story titles can be generated automatically. + 'storybook/no-title-property-in-meta': 'error', + }, +};