Skip to content

Commit

Permalink
docs(storybook): ✏️ fix controls type inferance
Browse files Browse the repository at this point in the history
  • Loading branch information
navin-moorthy committed Nov 5, 2020
1 parent 52730d6 commit 02b9f12
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 1 addition & 6 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const path = require("path");
const tsconfig = path.resolve(__dirname, "../tsconfig.json");
const tsconfig = path.resolve(__dirname, "../tsconfig.storybook.json");

module.exports = {
stories: ["../src/**/*.stories.@(js|jsx|ts|tsx)"],
Expand All @@ -13,13 +13,8 @@ module.exports = {
// Need to configure typescript manually otherwise addons will not infer from types
// https://github.com/storybookjs/storybook/issues/11146#issuecomment-643878741
typescript: {
check: false,
checkOptions: { tsconfig },
reactDocgen: "react-docgen-typescript",
reactDocgenTypescriptOptions: {
shouldExtractLiteralValuesFromEnum: true,
tsconfigPath: tsconfig,
propFilter: (prop: { name: string }) => !/^(testID)$/.test(prop.name),
},
},
};
6 changes: 6 additions & 0 deletions tsconfig.storybook.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"strictNullChecks": false
}
}

0 comments on commit 02b9f12

Please sign in to comment.