-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
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
npx husky initThis 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) ornpm 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
-
.husky/directory exists with a working pre-commit hook - Pre-commit hook runs lint and format checks on staged files
-
lint-stagedis installed and configured (or equivalent approach) - Hook runs in under 5 seconds for typical commits
-
npm ci(fresh install) sets up hooks automatically via Husky's prepare script - Documentation in README or CONTRIBUTING.md explains the hook setup
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request