chore(hooks): block pushes on knip errors

This commit is contained in:
Tunglies
2026-07-20 02:52:04 +08:00
parent c85928ecaf
commit d7dbff9f08
2 changed files with 10 additions and 1 deletions
+9 -1
View File
@@ -35,6 +35,14 @@ args = ["knip:report"]
[tasks.knip-report.windows]
command = "pnpm.cmd"
[tasks.knip-check]
description = "Fail on unused frontend code and dependencies"
command = "pnpm"
args = ["knip:check"]
[tasks.knip-check.windows]
command = "pnpm.cmd"
[tasks.lint-staged]
description = "Run lint-staged for staged files"
command = "pnpm"
@@ -126,6 +134,6 @@ end
has_frontend = exec git diff @{u}..HEAD --quiet -- "*.js" "*.jsx" "*.ts" "*.tsx" "*.json" "*.css" "*.scss" "*.html"
if eq ${has_frontend.code} 1
cm_run_task typecheck
cm_run_task knip-report
cm_run_task knip-check
end
'''
+1
View File
@@ -32,6 +32,7 @@
"i18n:format": "node scripts/cleanup-unused-i18n.mjs --align --apply",
"i18n:types": "node scripts/generate-i18n-keys.mjs",
"typecheck": "tsc --noEmit",
"knip:check": "knip",
"knip:report": "knip --no-exit-code"
},
"dependencies": {