mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-10-31 11:12:07 +08:00
chore(hooks): block pushes on knip errors
This commit is contained in:
+9
-1
@@ -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
|
||||
'''
|
||||
|
||||
@@ -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": {
|
||||
|
||||
Reference in New Issue
Block a user