{ // tsconfig.base.json,用于被 tesconfig.json 和 tesconfig.build.json 继承 "compilerOptions": { // 输出模块语法,使用版本号最新的那个,而不是实验性语法 ESNext "module": "es2022", // 模块解析策略,模拟 Vite / Rollup / webpack,支持 exports / imports,不强制 Node ESM 的严格规则 "moduleResolution": "bundler", // 显式声明使用的类型包 "types": ["node", "react", "vite/client"], // 开启所有严格类型检查,防止 any / 隐式 any 扩散 "strict": true, // 允许 ESM 导入 CJS "esModuleInterop": true, // 跳过 node_modules 类型检查,加快构建,避免第三方类型污染 "skipLibCheck": true } }