Skip to content

Commit e03bf78

Browse files
Add ESLint Storybook plugin
1 parent 088747c commit e03bf78

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

eslint.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { includeIgnoreFile } from '@eslint/compat';
88
import { defineConfig, globalIgnores } from 'eslint/config';
99
import globals from 'globals';
1010
import pluginImport from 'eslint-plugin-import';
11+
import pluginStorybook from 'eslint-plugin-storybook';
1112
import pluginTypeScript from 'typescript-eslint';
1213

1314
const rootPath = import.meta.dirname;
@@ -104,6 +105,7 @@ export default defineConfig([
104105
},
105106
{
106107
files: ['**/*.stories.tsx'],
108+
extends: [pluginStorybook.configs['flat/recommended']],
107109
rules: { '@typescript-eslint/no-unused-vars': 'off' },
108110
},
109111
globalIgnores(['**/coverage/', '**/dist/']),

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
"eslint-plugin-jsx-a11y": "^6.10.2",
103103
"eslint-plugin-react": "^7.37.5",
104104
"eslint-plugin-react-hooks": "^7.0.1",
105+
"eslint-plugin-storybook": "10.0.3",
105106
"globals": "^16.5.0",
106107
"jest": "^30.2.0",
107108
"jest-axe": "^10.0.0",

stories/Form Elements/Checkboxes.stories.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ export const WithError: Story = {
135135
hint: 'Select all that apply',
136136
},
137137
render: (args) => {
138-
// eslint-disable-next-line react-hooks/rules-of-hooks
139138
const [error, setError] = useState('Please select an option');
140139
return (
141140
<>

yarn.lock

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3653,7 +3653,7 @@ __metadata:
36533653
languageName: node
36543654
linkType: hard
36553655

3656-
"@typescript-eslint/utils@npm:8.46.2":
3656+
"@typescript-eslint/utils@npm:8.46.2, @typescript-eslint/utils@npm:^8.8.1":
36573657
version: 8.46.2
36583658
resolution: "@typescript-eslint/utils@npm:8.46.2"
36593659
dependencies:
@@ -5730,6 +5730,18 @@ __metadata:
57305730
languageName: node
57315731
linkType: hard
57325732

5733+
"eslint-plugin-storybook@npm:10.0.3":
5734+
version: 10.0.3
5735+
resolution: "eslint-plugin-storybook@npm:10.0.3"
5736+
dependencies:
5737+
"@typescript-eslint/utils": "npm:^8.8.1"
5738+
peerDependencies:
5739+
eslint: ">=8"
5740+
storybook: ^10.0.3
5741+
checksum: 10c0/f371668fe55e6d1f65a79e2d08902ca83aa175a643309fceea289b9420877b4a1753d2d42dcf6240e39e28700b0e4c86e8b1b9dc5a7b1ad95e9b5ce95a8da7ec
5742+
languageName: node
5743+
linkType: hard
5744+
57335745
"eslint-scope@npm:^8.4.0":
57345746
version: 8.4.0
57355747
resolution: "eslint-scope@npm:8.4.0"
@@ -8419,6 +8431,7 @@ __metadata:
84198431
eslint-plugin-jsx-a11y: "npm:^6.10.2"
84208432
eslint-plugin-react: "npm:^7.37.5"
84218433
eslint-plugin-react-hooks: "npm:^7.0.1"
8434+
eslint-plugin-storybook: "npm:10.0.3"
84228435
globals: "npm:^16.5.0"
84238436
jest: "npm:^30.2.0"
84248437
jest-axe: "npm:^10.0.0"

0 commit comments

Comments
 (0)