Reactjs 如何允许storybook在出现TypeScript(类型)错误的情况下生成?
我已经设置了CRA类型脚本模板,并将故事书集成到应用程序中。我现在使用的Chakra UI缺少对一些组件的typescript支持。当我运行Thread storybook时,应用程序运行并提供storybook应用程序,所有组件故事都可以正常工作。但是,当我使用命令Thread build storybook进行构建时,TypeScript错误会显示在控制台中,并且该命令会以退出代码1退出,而构建永远不会发生。如何设置配置,即使有TS错误,storybook仍然继续构建 下面的示例错误Reactjs 如何允许storybook在出现TypeScript(类型)错误的情况下生成?,reactjs,typescript,create-react-app,storybook,Reactjs,Typescript,Create React App,Storybook,我已经设置了CRA类型脚本模板,并将故事书集成到应用程序中。我现在使用的Chakra UI缺少对一些组件的typescript支持。当我运行Thread storybook时,应用程序运行并提供storybook应用程序,所有组件故事都可以正常工作。但是,当我使用命令Thread build storybook进行构建时,TypeScript错误会显示在控制台中,并且该命令会以退出代码1退出,而构建永远不会发生。如何设置配置,即使有TS错误,storybook仍然继续构建 下面的示例错误 tsc
tsconfig中有很多严格的类型检查选项,可以禁用这些选项以防止出现这些错误
/* Strict Type-Checking Options */
// "strict": true, /* Enable all strict type-checking options. */
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true, /* Enable strict null checks. */
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
对于您的具体情况,您可以在失败行上方键入以下内容。包括‘/’
// @ts-ignore
故事书v6.1+main.ts/main.js
来源:在构建期间添加@ts ignore没有帮助
module.exports = {
typescript: {
check: false
}
...
}