Skip to content

Latest commit

 

History

History
46 lines (34 loc) · 5.75 KB

storybook.md

File metadata and controls

46 lines (34 loc) · 5.75 KB

@code-pushup/eslint-config/storybook config

Config for projects using Storybook for UI components.

🏗️ Setup

  1. If you haven't already, make sure to install @code-pushup/eslint-config and its required peer dependencies.

  2. Since this plugin requires additional peer dependencies, you have to install them as well:

    npm install -D eslint-plugin-storybook
  3. Add to extends in your .eslintrc file:

    {
      "extends": ["@code-pushup/eslint-config/storybook"]
    }

📏 Rules (12)

🔧 Automatically fixable by the --fix CLI option.
💡 Manually fixable by editor suggestions.
🧪🚫 Disabled for test files.
🧪⚠️ Severity lessened to warning for test files.

🚨 Errors (7)

Plugin Rule Options Autofix Overrides
storybook await-interactions
Interactions should be awaited
🔧, 💡
storybook context-in-play-function
Pass a context when invoking play function of another story
storybook default-exports
Story files should have a default export
🔧, 💡
storybook no-uninstalled-addons
This rule identifies storybook addons that are invalid because they are either not installed or contain a typo in their name.
storybook story-exports
A story file must contain at least one story export
storybook use-storybook-expect
Use expect from @storybook/jest
🔧, 💡
storybook use-storybook-testing-library
Do not use testing-library directly on stories
🔧, 💡

⚠️ Warnings (5)

Plugin Rule Options Autofix Overrides
@typescript-eslint naming-convention
selector: variableLike, met...
[
{
"selector": [
"variableLike",
"method",
"typeProperty",
"parameterProperty",
"classProperty"
],
"format": [
"camelCase"
]
},
{
"selector": "variable",
"format": [
"camelCase",
"UPPER_CASE",
"PascalCase"
]
},
{
"selector": "typeLike",
"format": [
"PascalCase"
]
},
{
"selector": "enumMember",
"format": [
"PascalCase"
]
},
{
"selector": "parameter",
"modifiers": [
"unused"
],
"format": null,
"custom": {
"regex": "^(_+|[a-z][a-zA-Z0-9]*)$",
"match": true
}
},
{
"selector": "objectLiteralProperty",
"modifiers": [
"requiresQuotes"
],
"format": null
},
{
"selector": [
"variable",
"parameter"
],
"modifiers": [
"destructured"
],
"format": null
}
]
storybook csf-component
The component property should be set
storybook hierarchy-separator
Deprecated hierarchy separator in title property
🔧, 💡
storybook no-redundant-story-name
A story should not have a redundant name property
🔧, 💡
storybook prefer-pascal-case
Stories should use PascalCase
🔧, 💡