Problem
Nothing runs locally before a commit. Formatting and lint failures are only discovered in CI, causing avoidable round-trips.
Why it matters
Fast feedback at commit time > slow feedback at PR time. Also standardizes the dev experience across contributors.
Proposed approach
- Install
husky and lint-staged as devDependencies.
- Add
.husky/pre-commit running npx lint-staged.
- Configure
lint-staged in package.json:
"lint-staged": {
"*.ts": ["eslint --fix", "prettier --write"],
"*.{json,md,yml}": ["prettier --write"]
}
- Add
postinstall script: husky install.
- Document in CONTRIBUTING.md.
A superpowers:setup-pre-commit skill exists that does most of this — consider invoking it.
Acceptance criteria
- Committing a badly-formatted file triggers the hook.
- CONTRIBUTING.md mentions the hook and how to bypass (
--no-verify) with caution.
Problem
Nothing runs locally before a commit. Formatting and lint failures are only discovered in CI, causing avoidable round-trips.
Why it matters
Fast feedback at commit time > slow feedback at PR time. Also standardizes the dev experience across contributors.
Proposed approach
huskyandlint-stagedas devDependencies..husky/pre-commitrunningnpx lint-staged.lint-stagedinpackage.json:postinstallscript:husky install.A
superpowers:setup-pre-commitskill exists that does most of this — consider invoking it.Acceptance criteria
--no-verify) with caution.