[英]How to allow storybook to build even with TypeScript (type) errors?
Storybook v6.1+ main.ts
/ main.js
module.exports = {
typescript: {
check: false
}
...
}
来源: https : //storybook.js.org/docs/react/configure/typescript
您的 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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.