Is your feature request related to a problem? Please describe
Will be great the fork-ts-checker-webpack-plugin can be updated to v5 in the future. It allows a concise way of overriding include field in tsconfig.json via configOverwrite to allow easier type-checking of story files (*.stories.ts).
Describe the solution you'd like
I was hoping to do something like:
// .storybook/main.js
module.exports = {
...
typescript: {
check: true, // Enabling fork-ts-checker-webpack-plugin for unlocking type-checking
checkOptions: {
typescript: {
configOverwrite: { include: ["./src/**/*.stories.tsx"] }
}
}
},
}
Describe alternatives you've considered
Other solutions that I tried seemed a little lengthy. I'd prefer not to modify the default Storybook Webpack config whenever possible.
Another (working) solution I tried is:
// .storybook/main.js
module.exports = {
...
typescript: {
check: true, // Enabling fork-ts-checker-webpack-plugin for unlocking type-checking
checkOptions: {
checkOptions: {
tsconfig: "./tsconfig.storybook.json",
},
}
},
}
// tsconfig.storybook.json
{
"extends": "./tsconfig.json",
"include": ["./src/**/*.stories.tsx"]
}
Are you able to assist to bring the feature to reality?
Can help with testing once it is installed onto master.
Additional context
https://github.com/storybookjs/storybook/issues/11804#issuecomment-668936341
@shilman
Can I try this?
Hello all, a little heads up: fork-ts-checker-webpack-plugin recently released a 6.x pre-release (-alpha.1) which addresses https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/issues/36 as mentioned here: https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/issues/36#issuecomment-710771939. That fix is quite useful in Storybook's watch (start-storybook) mode as it makes the type checking feature more _complete_.
Most helpful comment
@shilman
Can I try this?