1
0

refactor: 重写 Git hooks 体系,委托已有检查、新增模板与 LFS 校验

pre-commit 代码检查改为委托 _backend-lint / _versionctl-lint / _frontend-check,新增 LFS 指针校验;commit-msg 新增多行空行格式校验和模板注释忽略,移除 CJK/Python 字符集检测;新增 prepare-commit-msg 提交信息模板;hooks-install 增加 source 文件存在性校验;前端 check 补入 tsc -b 类型检查并修复暴露的类型错误
This commit is contained in:
2026-05-06 13:44:28 +08:00
parent 5513f0c13d
commit c04a13bf8a
13 changed files with 443 additions and 111 deletions

View File

@@ -149,7 +149,8 @@ bun run build
```bash
bun run lint # ESLint 检查
bun run format:check # Prettier 格式检查
bun run check # 同时检查 lint 和格式
bun run typecheck # TypeScript 类型检查
bun run check # 同时检查类型、lint 和格式
```
### 代码格式化

View File

@@ -6,12 +6,13 @@
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && bun run check && vite build",
"build": "bun run check && vite build",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"format": "prettier --write .",
"format:check": "prettier --check .",
"check": "bun run lint && bun run format:check",
"typecheck": "tsc -b",
"check": "bun run typecheck && bun run lint && bun run format:check",
"fix": "bun run lint:fix && bun run format",
"preview": "vite preview",
"test": "vitest run",

View File

@@ -38,7 +38,9 @@ export function ModelTable({ providerId, onAdd, onEdit }: ModelTableProps) {
text: id,
onCopy: () => MessagePlugin.success('已复制统一模型 ID'),
}}
/>
>
{''}
</Typography.Text>
</span>
) : null
},

View File

@@ -51,7 +51,9 @@ export function ProviderTable({
text: row.baseUrl,
onCopy: () => MessagePlugin.success('已复制 Base URL'),
}}
/>
>
{''}
</Typography.Text>
</span>
) : null,
},
@@ -87,7 +89,9 @@ export function ProviderTable({
text: row.apiKey,
onCopy: () => MessagePlugin.success('已复制 API Key'),
}}
/>
>
{''}
</Typography.Text>
</span>
) : null,
},