Skip to content

Commit a100924

Browse files
authored
Merge pull request #149 from storybookjs/norbert/add-off-switch-react-hooks-in-stories
Disable rule of hooks in stories files
2 parents a053ba9 + b9dd4e1 commit a100924

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

lib/configs/addon-interactions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export = {
99
{
1010
files: ['*.stories.@(ts|tsx|js|jsx|mjs|cjs)', '*.story.@(ts|tsx|js|jsx|mjs|cjs)'],
1111
rules: {
12+
'react-hooks/rules-of-hooks': 'off',
1213
'import/no-anonymous-default-export': 'off',
1314
'storybook/await-interactions': 'error',
1415
'storybook/context-in-play-function': 'error',

lib/configs/csf-strict.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
export = {
77
extends: require.resolve('./csf'),
88
rules: {
9+
'react-hooks/rules-of-hooks': 'off',
910
'import/no-anonymous-default-export': 'off',
1011
'storybook/no-stories-of': 'error',
1112
'storybook/no-title-property-in-meta': 'error',

lib/configs/csf.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export = {
99
{
1010
files: ['*.stories.@(ts|tsx|js|jsx|mjs|cjs)', '*.story.@(ts|tsx|js|jsx|mjs|cjs)'],
1111
rules: {
12+
'react-hooks/rules-of-hooks': 'off',
1213
'import/no-anonymous-default-export': 'off',
1314
'storybook/csf-component': 'warn',
1415
'storybook/default-exports': 'error',

lib/configs/recommended.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export = {
99
{
1010
files: ['*.stories.@(ts|tsx|js|jsx|mjs|cjs)', '*.story.@(ts|tsx|js|jsx|mjs|cjs)'],
1111
rules: {
12+
'react-hooks/rules-of-hooks': 'off',
1213
'import/no-anonymous-default-export': 'off',
1314
'storybook/await-interactions': 'error',
1415
'storybook/context-in-play-function': 'error',

0 commit comments

Comments
 (0)