antvis/G6

[V5]build时tsc报错 #5932

Fly-Potato posted onGitHub

Describe the bug / 问题描述

版本:5.0.4 运行npm run build 报错,build失败 使用npm run dev 运行时无异常 tsconfig是默认设置

image image

No response

Steps to Reproduce the Bug or Issue / 重现步骤

No response

G6 Version / G6 版本

🆕 5.x

Operating System / 操作系统

Linux

Browser / 浏览器

Edge

Additional context / 补充说明

No response


tsconfig

{
  "compilerOptions": {
    "target": "ES2020",
    "useDefineForClassFields": true,
    "lib": ["ES2020", "DOM", "DOM.Iterable"],
    "module": "ESNext",
    "skipLibCheck": true,

    /* Bundler mode */
    "moduleResolution": "bundler",
    "allowImportingTsExtensions": true,
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "jsx": "react-jsx",

    /* Linting */
    "strict": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "noFallthroughCasesInSwitch": true,
    "baseUrl": ".",
    "paths": {
      "@/*": [
        "./src/*"
      ]
    }
  },
  "include": ["src"],
  "references": [{ "path": "./tsconfig.node.json" }]
}
posted by Fly-Potato 10 months ago

在 "compilerOptions" 下加入下列配置:

"experimentalDecorators": true,

移除

"noUnusedLocals": true,
"noUnusedParameters": true,

建议使用 eslint

posted by Aarebecca 10 months ago

在 "compilerOptions" 下加入下列配置:

"experimentalDecorators": true,

移除

"noUnusedLocals": true,
"noUnusedParameters": true,

建议使用 eslint

谢谢,我照做了,但还有3个报错 image

posted by Fly-Potato 10 months ago

skipLibCheck打包应该会不检查库

posted by mioxs 10 months ago

已解决

posted by Fly-Potato 10 months ago

Fund this Issue

$0.00
Funded

Pull requests