diff --git a/Makefile.toml b/Makefile.toml index a5a757eca..2365028e9 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -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 ''' diff --git a/package.json b/package.json index 11cd1f9cc..adf48d44c 100644 --- a/package.json +++ b/package.json @@ -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": {