Skip to content

Commit 46e1a9f

Browse files
committed
feat: disable react-hooks/rules-of-hooks and import/no-default-export rules for storybook files
1 parent 80122c4 commit 46e1a9f

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/configs/imports.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ export async function imports(): Promise<ESLintFlatConfig<ImportRules>[]> {
4646
`**/{views,pages,routes,middleware,plugins,api}/${GLOB_SRC}`,
4747
`**/{index,vite,esbuild,rollup,rolldown,webpack,rspack}.ts`,
4848
'**/*.d.ts',
49+
'**/.storybook/*.@(ts|tsx|js|jsx|mjs|cjs)',
50+
'**/*.@(stories|story).@(ts|tsx|js|jsx|mjs|cjs)',
4951
],
5052
plugins: {
5153
import: ImportPlugin,

src/configs/react.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,5 +103,18 @@ export async function react(options: ReactOptions = {}): Promise<ESLintFlatConfi
103103
},
104104
},
105105
},
106+
{
107+
name: 'thinkbuff:react:disable-rules-of-hooks',
108+
files: [
109+
'**/.storybook/*.@(ts|tsx|js|jsx|mjs|cjs)',
110+
'**/*.@(stories|story).@(ts|tsx|js|jsx|mjs|cjs)',
111+
],
112+
plugins: {
113+
'react-hooks': ReactHookPlugin,
114+
},
115+
rules: {
116+
'react-hooks/rules-of-hooks': 'off',
117+
},
118+
},
106119
];
107120
}

0 commit comments

Comments
 (0)