Skip to content

Commit

Permalink
perf: 减少 tsc noEmit 配置硬编码
Browse files Browse the repository at this point in the history
  • Loading branch information
pany-ang committed Dec 13, 2024
1 parent 1fa9d8c commit 5aa09b0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 全局 ts 类型检查(此操作会增加 git commit 时长)
npx vue-tsc --noEmit
npx vue-tsc
# 执行 lint-staged 中配置的任务
npx lint-staged
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"repository": "https://github.com/un-pany/v3-admin-vite",
"scripts": {
"dev": "vite",
"build:staging": "vue-tsc --noEmit && vite build --mode staging",
"build": "vue-tsc --noEmit && vite build",
"build:staging": "vue-tsc && vite build --mode staging",
"build": "vue-tsc && vite build",
"preview": "vite preview",
"lint": "eslint . --fix",
"prepare": "husky",
Expand Down
4 changes: 4 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,15 @@
},
"resolveJsonModule": true,
"types": ["vite/client", "element-plus/global"],
// 允许导入 .ts .mts .tsx 拓展名的文件
"allowImportingTsExtensions": true,
// 允许 JS
"allowJs": true,
// TS 严格模式
"strict": true,
"importHelpers": true,
// 不输出任何编译后的文件,只进行类型检查
"noEmit": true,
"sourceMap": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
Expand Down

0 comments on commit 5aa09b0

Please sign in to comment.