Problem
Husky v9 is installed as a dev dependency but is not configured — there is no .husky/ directory. Developers can commit code that fails lint or format checks, which then fails in CI. Catching these issues locally saves CI time and reduces failed PR builds.
Scope of Work
1. Initialize Husky
This creates the .husky/ directory and a sample pre-commit hook.
2. Configure pre-commit hook
Create .husky/pre-commit that runs:
npx lint-staged (preferred) or npm run lint && npm run format -- --check
3. Add lint-staged (recommended)
Install lint-staged and configure in package.json:
"lint-staged": {
"*.{ts,tsx,astro}": ["eslint --fix"],
"*.{ts,tsx,astro,css,md,json}": ["prettier --write"]
}
This only checks staged files rather than the entire codebase, keeping the hook fast.
Acceptance Criteria
Problem
Husky v9 is installed as a dev dependency but is not configured — there is no
.husky/directory. Developers can commit code that fails lint or format checks, which then fails in CI. Catching these issues locally saves CI time and reduces failed PR builds.Scope of Work
1. Initialize Husky
This creates the
.husky/directory and a sample pre-commit hook.2. Configure pre-commit hook
Create
.husky/pre-committhat runs:npx lint-staged(preferred) ornpm run lint && npm run format -- --check3. Add lint-staged (recommended)
Install
lint-stagedand configure inpackage.json:This only checks staged files rather than the entire codebase, keeping the hook fast.
Acceptance Criteria
.husky/directory exists with a working pre-commit hooklint-stagedis installed and configured (or equivalent approach)npm ci(fresh install) sets up hooks automatically via Husky's prepare script