Skip to content

Commit a522438

Browse files
fix(deps): update dependency eslint-plugin-storybook to v9 (#386)
* fix(deps): update dependency eslint-plugin-storybook to v9 * disable `storybook/no-renderer-packages` rule * update readme * disable `storybook/no-renderer-packages` rule --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: wakamsha <wakamsha@gmail.com>
1 parent 00e0eef commit a522438

File tree

7 files changed

+301
-24
lines changed

7 files changed

+301
-24
lines changed

packages/eslint-config/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ We also provide various other rule sets that you can configure to suit your proj
112112
| `next` | Contains Next.js recommended rules | [`@next/eslint-plugin-next`](https://github.com/vercel/next.js/tree/canary/packages/eslint-plugin-next) |
113113
| `node` | Contains Node.js recommended rules | [`eslint-plugin-n`](https://github.com/eslint-community/eslint-plugin-n) |
114114
| `react` | Contains React recommended rules | [`eslint-plugin-jsx-a11y`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y) <br> [`eslint-plugin-react-hooks`](https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks) <br> [`eslint-plugin-react`](https://github.com/jsx-eslint/eslint-plugin-react) |
115-
| `storybook` | Contains Storybook recommended rules | [`eslint-plugin-storybook`](https://github.com/storybookjs/eslint-plugin-storybook) |
115+
| `storybook` | Contains Storybook recommended rules | [`eslint-plugin-storybook`](https://github.com/storybookjs/storybook/tree/next/code/lib/eslint-plugin) |
116116
| `test/react` | Contains Jest and React Testing Library rules | [`eslint-plugin-jest`](https://github.com/jest-community/eslint-plugin-jest) <br> [`eslint-plugin-jest-dom`](https://github.com/testing-library/eslint-plugin-jest-dom) <br> [`eslint-plugin-testing-library`](https://github.com/testing-library/eslint-plugin-testing-library) |
117117
| `typescript` | Contains TypeScript recommended rules | [`@eslint-typescript/eslint-plugin`](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin) <br> [`@eslint-typescript/parser`](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/parser) |
118118

packages/eslint-config/configs/flat/storybook.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ export default [
2121
],
2222
rules: {
2323
'import/no-default-export': ['off'],
24+
25+
// Turn off this rule because type definitions such as `Meta` and `StoryObj` need to be imported from `@storybook/react`.
26+
// https://github.com/storybookjs/storybook/blob/next/code/lib/eslint-plugin/docs/rules/no-renderer-packages.md
27+
'storybook/no-renderer-packages': ['off'],
2428
},
2529
},
2630
];

packages/eslint-config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"eslint-plugin-promise": "^7.2.1",
6363
"eslint-plugin-react": "^7.37.2",
6464
"eslint-plugin-react-hooks": "^5.0.0",
65-
"eslint-plugin-storybook": "^0.11.1",
65+
"eslint-plugin-storybook": "^9.0.4",
6666
"eslint-plugin-testing-library": "^7.0.0",
6767
"eslint-plugin-unicorn": "^56.0.1",
6868
"globals": "^15.11.0",

packages/eslint-config/rules/storybook.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ module.exports = {
22
plugins: ['storybook'],
33
extends: ['plugin:storybook/recommended'],
44
rules: {
5+
// Turn off this rule because type definitions such as `Meta` and `StoryObj` need to be imported from `@storybook/react`.
6+
// https://github.com/storybookjs/storybook/blob/next/code/lib/eslint-plugin/docs/rules/no-renderer-packages.md
7+
'storybook/no-renderer-packages': ['off'],
8+
59
// `storiesOf` is deprecated and should not be used
610
// https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/no-stories-of.md
711
// Since Storybook 5.2, the CSF format was introduced and the storiesOf API has been deprecated.

packages/eslint-config/tests/snapshot-test/eslintrc/storybook/__snapshots__/snapshot.test.js.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2443,6 +2443,9 @@ exports[`should match ESLint configuration snapshot: storybook 1`] = `
24432443
"storybook/no-redundant-story-name": [
24442444
1,
24452445
],
2446+
"storybook/no-renderer-packages": [
2447+
0,
2448+
],
24462449
"storybook/no-stories-of": [
24472450
2,
24482451
],

packages/eslint-config/tests/snapshot-test/flat/storybook/__snapshots__/snapshot.test.js.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2672,6 +2672,9 @@ exports[`ESLint Configuration Snapshot Tests should match ESLint Flat Configurat
26722672
"storybook/no-redundant-story-name": [
26732673
1,
26742674
],
2675+
"storybook/no-renderer-packages": [
2676+
0,
2677+
],
26752678
"storybook/no-stories-of": [
26762679
2,
26772680
],

0 commit comments

Comments
 (0)