Skip to content

Commit 5aa09b0

Browse files
committed
perf: 减少 tsc noEmit 配置硬编码
1 parent 1fa9d8c commit 5aa09b0

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# 全局 ts 类型检查(此操作会增加 git commit 时长)
2-
npx vue-tsc --noEmit
2+
npx vue-tsc
33
# 执行 lint-staged 中配置的任务
44
npx lint-staged

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"repository": "https://github.com/un-pany/v3-admin-vite",
88
"scripts": {
99
"dev": "vite",
10-
"build:staging": "vue-tsc --noEmit && vite build --mode staging",
11-
"build": "vue-tsc --noEmit && vite build",
10+
"build:staging": "vue-tsc && vite build --mode staging",
11+
"build": "vue-tsc && vite build",
1212
"preview": "vite preview",
1313
"lint": "eslint . --fix",
1414
"prepare": "husky",

tsconfig.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,15 @@
2323
},
2424
"resolveJsonModule": true,
2525
"types": ["vite/client", "element-plus/global"],
26+
// 允许导入 .ts .mts .tsx 拓展名的文件
27+
"allowImportingTsExtensions": true,
2628
// 允许 JS
2729
"allowJs": true,
2830
// TS 严格模式
2931
"strict": true,
3032
"importHelpers": true,
33+
// 不输出任何编译后的文件,只进行类型检查
34+
"noEmit": true,
3135
"sourceMap": true,
3236
"allowSyntheticDefaultImports": true,
3337
"esModuleInterop": true,

0 commit comments

Comments
 (0)