小编Jae*_*ang的帖子

导入react-admin 破坏 tsc 构建

我使用反应管理和打字稿。
我更喜欢使用strict类型检查。所以当我运行时tsc,react admin 向我显示一个implicitly any错误。
虽然我用了"skipLibCheck": true,但是还是报错了。我该如何修复它?

node_modules/ra-core/src/auth/useCheckAuth.ts:101:26 - error TS7006: Parameter 'error' implicitly has an 'any' type.

101 const getErrorMessage = (error, defaultMessage) =>
                             ~~~~~
Run Code Online (Sandbox Code Playgroud)

下面是我的 tsconfig 文件。

{
  "compilerOptions": {
    "baseUrl": ".",
    "target": "es5",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "paths": {
      "@components/*": ["components/*"],
      "@styles/*": ["styles/*"],
      "@lib/*": ["lib/*"],
      "@pages/*": ["pages/*"] …
Run Code Online (Sandbox Code Playgroud)

node-modules typescript tsc reactjs react-admin

3
推荐指数
1
解决办法
405
查看次数

标签 统计

node-modules ×1

react-admin ×1

reactjs ×1

tsc ×1

typescript ×1