From 09f941a7b71b979afede6c077b89f1ff6d2691f2 Mon Sep 17 00:00:00 2001 From: pany <939630029@qq.com> Date: Thu, 21 Apr 2022 12:05:43 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20ts=20=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tsconfig.json | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 85b1e03..062d523 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,8 +5,12 @@ "useDefineForClassFields": true, "module": "esnext", "moduleResolution": "node", + /** ts 严格模式 */ "strict": true, "jsx": "preserve", + "importHelpers": true, + "experimentalDecorators": true, + "allowSyntheticDefaultImports": true, "sourceMap": true, "resolveJsonModule": true, /** https://vitejs.cn/guide/features.html#typescript-compiler-options */ @@ -17,12 +21,19 @@ "dom" ], "skipLibCheck": true, - "types": ["vite/client"], + "types": [ + "node", + "vite/client", + /** element-plus 的 volar 插件支持 */ + // "element-plus/global" + ], /** baseUrl 用来告诉编译器到哪里去查找模块,使用非相对模块时必须配置此项 */ "baseUrl": ".", - // 非相对模块导入的路径映射配置,根据 baseUrl 配置进行路径计算 + /** 非相对模块导入的路径映射配置,根据 baseUrl 配置进行路径计算 */ "paths": { - "@/*": ["src/*"] + "@/*": [ + "src/*" + ] }, }, "include": [ @@ -30,6 +41,12 @@ "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue", + "types/**/*.d.ts", "vite.config.ts" + ], + /** 编译器默认排除的编译文件 */ + "exclude": [ + "node_modules", + "dist" ] }