Replaces the Python pre-commit framework (.pre-commit-config.yaml) with husky 9, kept faithful to the existing checks: - Block direct commits to main (was: no-commit-to-branch). - git diff --cached --check covers trailing-whitespace and merge-conflict marker detection. - Custom large-file check (>500KB), excluding crawler test fixtures. - Backend Go: gofmt -l (fail on diff), go vet, golangci-lint — only when backend/*.go is staged. - Backend deps: go mod tidy -diff — only when go.mod/go.sum is staged. - Web: prettier --check, eslint, svelte-check — only when web/ is staged. lint-staged was intentionally not adopted — the previous config ran hooks tree-wide (pass_filenames: false), so per-file optimisation would be a behaviour change. Install: pnpm install at repo root (the prepare script wires husky into .git/hooks via core.hooksPath=.husky/_).
13 lines
297 B
JSON
13 lines
297 B
JSON
{
|
|
"name": "marktvogt-monorepo",
|
|
"private": true,
|
|
"description": "Repo-root tooling — husky pre-commit hooks. Application code lives in backend/, web/, app/.",
|
|
"packageManager": "pnpm@10.33.0",
|
|
"scripts": {
|
|
"prepare": "husky"
|
|
},
|
|
"devDependencies": {
|
|
"husky": "^9.1.7"
|
|
}
|
|
}
|