chore: 修复 lint-staged 与 husky 配置适配当前工具链
- lint-staged: TS 暂移除 eslint(ESLint 9 flat config 缺失) - lint-staged: Go 暂移除 golangci-lint(未安装) - lint-staged: gofmt 仅处理 .go(不处理 .mod/.sum) - husky: 去除 commit-msg/pre-commit 的 UTF-8 BOM - husky: 新增 pre-push hook(Go 编译检查)
This commit is contained in:
@@ -1 +1 @@
|
||||
npx --no-install commitlint --edit $1
|
||||
npx --no-install commitlint --edit $1
|
||||
|
||||
@@ -1 +1 @@
|
||||
npx --no-install lint-staged
|
||||
npx --no-install lint-staged
|
||||
|
||||
15
.husky/pre-push
Normal file
15
.husky/pre-push
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env sh
|
||||
# pre-push hook:推送前编译检查
|
||||
# Go 服务必须通过 go build(TS typecheck 在 ESLint 9 flat config 迁移完成后启用)
|
||||
|
||||
# Go 服务编译检查
|
||||
for d in services/api-gateway services/push-gateway; do
|
||||
if [ -d "$d" ]; then
|
||||
(cd "$d" && go build ./... ) || {
|
||||
echo "[pre-push] FAIL: $d go build 失败"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
done
|
||||
|
||||
echo "[pre-push] OK: Go 服务编译检查通过"
|
||||
Reference in New Issue
Block a user