storybookjs/eslint-plugin-storybook được TopGit xếp vào nhóm dự án UI/UX, với 289 sao trên GitHub, viết chủ yếu bằng TypeScript. 🎗Official ESLint plugin for Storybook
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
This package has moved and is now part of the Storybook monorepo since version 9. Please update your dependencies. This repository is no longer maintained. If there are issues or requests, please report them in the Storybook monorepo.
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
And finally, add this to your .eslintignore file:
// Inside your .eslintignore file
!.storybook
This allows for this plugin to also lint your configuration files inside the .storybook folder, so that you always have a correct configuration and don't face any issues regarding mistyped addon names, for instance.
For more info on why this line is required in the .eslintignore file, check this ESLint documentation.
If you are using flat config style, add this to your configuration file:
Use the following table to use the correct version of this package, based on the version of ESLint you're using:
ESLint version
Storybook plugin version
^9.0.0
^0.10.0
^8.57.0
^0.10.0
^7.0.0
~0.9.0
Usage
Configuration (.eslintrc)
Use .eslintrc.* file to configure rules in ESLint < v9. See also: https://eslint.org/docs/latest/use/configure/.
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"]
}
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.
Overriding/disabling rules
Optionally, you can override, add or disable rules settings. You likely don't want these settings to be applied in every file, so make sure that you add a overrides section in your .eslintrc.* file that applies the overrides only to your stories files.
{
"overrides": [
{
// or whatever matches stories specified in .storybook/main.js
"files": ['**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)'],
"rules": {
// example of overriding a rule
'storybook/hierarchy-separator': 'error',
// example of disabling a rule
'storybook/default-exports': 'off',
}
}
]
}
Configuration (eslint.config.[c|m]?js)
Use eslint.config.[c|m]?js file to configure rules using the flat config style. This is the default in ESLint v9, but can be used starting from ESLint v8.57.0. See also: https://eslint.org/docs/latest/use/configure/configuration-files-new.
import storybook from 'eslint-plugin-storybook'
export default [
// add more generic rulesets here, such as:
// js.configs.recommended,
...storybook.configs['flat/recommended'],
// something ...
]
In case you are using utility functions from tools like tseslint, you might need to set the plugin a little differently:
import storybook from "eslint-plugin-storybook";
import somePlugin from 'some-plugin';
import tseslint from 'typescript-eslint';
export default tseslint.config(
somePlugin,
storybook.configs["flat/recommended"] // notice that it is not destructured
);"
Overriding/disabling rules
Optionally, you can override, add or disable rules settings. You likely don't want these settings to be applied in every file, so make sure that you add a flat config section in your eslint.config.[m|c]?js file that applies the overrides only to your stories files.
import storybook from 'eslint-plugin-storybook'
export default [
// ...
...storybook.configs['flat/recommended'],
{
files: ['**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)'],
rules: {
// example of overriding a rule
'storybook/hierarchy-separator': 'error',
// example of disabling a rule
'storybook/default-exports': 'off',
},
},
// something ...
]
storybookjs/eslint-plugin-storybook thuộc nhóm UI / UX trên TopGit, cùng 3 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về storybookjs/eslint-plugin-storybook ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/storybookjs/eslint-plugin-storybook là nguồn chính thức.
storybookjs/eslint-plugin-storybook có phải mã nguồn mở không?
Có — storybookjs/eslint-plugin-storybook phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/storybookjs/eslint-plugin-storybook.
storybookjs/eslint-plugin-storybook là gì?
storybookjs/eslint-plugin-storybook (storybookjs/eslint-plugin-storybook) là dự án TypeScript trên GitHub. Theo mô tả gốc: 🎗Official ESLint plugin for Storybook
storybookjs/eslint-plugin-storybook so với các dự án UI / UX khác thế nào?
storybookjs/eslint-plugin-storybook được TopGit xếp vào nhóm UI / UX, với 289 sao GitHub và viết bằng TypeScript. Xem trang chủ đề UI / UX trên TopGit để so sánh với các dự án tương tự theo số sao và mức độ hoạt động.
Vì sao storybookjs/eslint-plugin-storybook được xếp vào nhóm UI / UX?
TopGit xếp storybookjs/eslint-plugin-storybook vào nhóm UI / UX dựa trên GitHub topics và mô tả của repo (gắn thẻ: "eslint", "eslint-plugin", "storybook"). Việc phân loại dựa trên metadata thật của repo, không phải đoán theo cảm tính biên tập.
Đọc đầy đủ README ở tab phía trên.
eslint-plugin-storybook có đáng để bạn bỏ thời gian?
ChatGPT, Claude và Perplexity đều đọc được trang này. Hỏi thử xem họ nghĩ gì về eslint-plugin-storybook.