{ "extends": "@vue/tsconfig/tsconfig.json", "compilerOptions": { "target": "ES2020", // 指定 ECMAScript 目标版本: 'ES3' (default), 'ES5', 'ES6'/'ES2015', 'ES2016', 'ES2017', or 'ESNEXT' "jsx": "preserve", // 指定 jsx 代码的生成: 'preserve', 'react-native', or 'react' "jsxFactory": "h", // 当使用经典的JSX运行时,更改.js文件中调用的函数,默认:React.createElement "jsxFragmentFactory": "Fragment", // 指定 JSX 片段工厂函数 "lib": [ "ES2022", "DOM" ], // 指定要包含在编译中的库文件。必须含 ES2022 —— // gi-demo 的 useBreakpoint / useTabsStore 用了 Array.prototype.at(), // 停在 ES2020 会让 `pnpm typecheck` 报 TS2550(运行期是好的:Vite 按浏览器实际能力打包) "baseUrl": ".", // 用于解析非相对模块名称的基目录 "module": "ES2020", // "moduleResolution": "bundler", "paths": { "@/*": [ "src/*" ] // 模块名到基于 baseUrl 的路径映射的列表 }, "resolveJsonModule": true, // 是否解析 JSON 文件 "allowJs": true, // 允许编译 javascript 文件 "checkJs": true, // 报告 javascript 文件中的错误 "strict": true, // 开启所有严格的类型检查 "noImplicitAny": false, "sourceMap": true, // 是否生成相应的Map映射的文件,默认:false "esModuleInterop": true, // 是否通过为所有导入模块创建命名空间对象,允许CommonJS和ES模块之间的互操作性 "skipLibCheck": true, // 是否跳过声明文件的类型检查 "ignoreDeprecations": "5.0" // 消除 importsNotUsedAsValues 的弃用报错 }, "include": [ "src/**/*", "src/**/*.vue", "vite.config.ts" ], // 指定被编译文件所在的目录 "exclude": [ "node_modules", "dist", "**/*.js" ] // 指定不需要被编译的目录 }