JSPM

eslint-plugin-storybook

0.2.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4054363
  • Score
    100M100P100Q178984F
  • License MIT

Best practice rules for Storybook

Package Exports

  • eslint-plugin-storybook
  • eslint-plugin-storybook/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eslint-plugin-storybook) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Storybook

Build bulletproof UI components faster


Storybook Community Backers on Open Collective Sponsors on Open Collective Official Twitter Handle

eslint-plugin-storybook

Best practice rules for Storybook

Installation

You'll first need to install ESLint:

npm install eslint --save-dev
# or
yarn add eslint --dev

Next, install eslint-plugin-storybook:

npm install eslint-plugin-storybook --save-dev
# or
yarn add eslint-plugin-storybook --dev

Usage

Use .eslintrc.* file to configure rules. See also: https://eslint.org/docs/user-guide/configuring

Add plugin:storybook/recommended to the extends section of your .eslintrc configuration file. Note that we can omit the eslint-plugin- prefix:

{
  // extend plugin:storybook/<configuration>, such as:
  "extends": ["plugin:storybook/recommended"],
  // Optional: override/add/disable rules settings here, such as:
  "rules": {
    // 'storybook/no-redundant-story-name': 'error'
  }
}

This plugin will only be applied to files following the *.stories.* (we recommend this) or *.story.* pattern. This is an automatic configuration, so you don't have to do anything.

MDX Support

This plugin does not support MDX files.

Supported Rules and configurations

Key: 🔧 = fixable

Configurations: csf, csf-strict, addon-interactions, recommended

Name Description 🔧 Included in configurations
storybook/await-interactions Interactions should be awaited 🔧
  • addon-interactions
  • recommended
storybook/csf-component The component property should be set
  • csf
storybook/default-exports Story files should have a default export
  • csf
  • recommended
storybook/hierarchy-separator Deprecated hierachy separator in title property 🔧
  • csf
  • recommended
storybook/no-redundant-story-name A story should not have a redundant name property 🔧
  • csf
  • recommended
storybook/no-stories-of storiesOf is deprecated and should not be used
  • csf-strict
storybook/no-title-property-in-meta Do not define a title in meta 🔧
  • csf-strict
storybook/prefer-pascal-case Stories should use PascalCase 🔧
  • recommended
storybook/use-storybook-expect Use expect from @storybook/jest 🔧
  • addon-interactions
  • recommended
storybook/use-storybook-testing-library Do not use testing-library directly on stories 🔧
  • addon-interactions
  • recommended

Contributors

Looking into improving this plugin? That would be awesome! Please refer to the contributing guidelines for steps to contributing.