共享的 TypeScript 配置
pnpm add -D typescript @yunzhen/tsconfig在项目的 tsconfig.json 中选择一个配置:
{
"extends": "@yunzhen/tsconfig/base.json"
}| 配置 | 适用场景 |
|---|---|
@yunzhen/tsconfig/base.json |
严格的通用基础配置 |
@yunzhen/tsconfig/library.json |
需要生成声明文件的构建库 |
@yunzhen/tsconfig/web.json |
Vite 和 React Web 应用 |
@yunzhen/tsconfig/node.json |
Node.js 应用 |
使用 node.json 的项目还需要安装 @types/node。