diff --git a/.storybook/config.js b/.storybook/config.js index 55213369..8f54bc13 100644 --- a/.storybook/config.js +++ b/.storybook/config.js @@ -1,6 +1,6 @@ import {configure} from '@storybook/react'; -const req = require.context('../src/stories/', true, /.*\.(stories|story)\.(js|jsx|ts|tsx)?$/); +const req = require.context('../src/__stories__/', true, /.*\.(stories|story)\.(js|jsx|ts|tsx)?$/); const loadStories = () => { req.keys().forEach((filename) => req(filename)); diff --git a/src/stories/useToggle.story.tsx b/src/__stories__/useToggle.story.tsx similarity index 67% rename from src/stories/useToggle.story.tsx rename to src/__stories__/useToggle.story.tsx index a119fe44..0ddec2a8 100644 --- a/src/stories/useToggle.story.tsx +++ b/src/__stories__/useToggle.story.tsx @@ -3,12 +3,14 @@ import {storiesOf} from '@storybook/react'; import {useToggle} from '..'; const Demo = () => { - const [on, toggle] = useToggle(true); + const [on, toggle, set] = useToggle(true); return (
{on ? 'ON' : 'OFF'}
+ +
); }; diff --git a/src/stories/useWindowSize.story.tsx b/src/__stories__/useWindowSize.story.tsx similarity index 100% rename from src/stories/useWindowSize.story.tsx rename to src/__stories__/useWindowSize.story.tsx diff --git a/tsconfig.json b/tsconfig.json index 1cfc78d7..6c56125f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,7 +7,7 @@ "declaration": true, "pretty": true, "rootDir": "src", - "sourceMap": true, + "sourceMap": false, "strict": true, "noUnusedLocals": false, "noUnusedParameters": false, @@ -16,5 +16,13 @@ "noFallthroughCasesInSwitch": true, "outDir": "lib", "lib": ["es2018", "dom"] - } + }, + "exclude": [ + "node_modules", + "lib", + "**/__tests__/**/*", + "**/__stories__/**/*", + "*.test.ts", + "*.test.tsx" + ] }