-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Upgrade Husky to v10 and migrate hooks
Summary
Husky prints a deprecation warning for our current pre-commit script lines and they will fail in v10. We should upgrade to v10 and migrate our hooks to the new style.
Background
Current warning observed during commits:
husky - DEPRECATED
Please remove the following two lines from .husky/pre-commit:
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
They WILL FAIL in v10.0.0
Proposed Plan
- Upgrade Husky
- npm install -D husky@latest
- npx husky init # regenerates .husky/ and updates prepare script
- Migrate hooks to v10 style
- Remove sourcing of _/husky.sh from all hooks
- Keep our conditional wiki check (only when .wiki-edit/*.md staged)
- Keep lint-staged invocation as-is
- Update package.json
- Ensure prepare script matches v10 recommendation ("husky")
- Verify behavior
- Commit with no wiki changes: skips wiki checker
- Commit with wiki changes: runs wiki checker
- CI passes on PRs
Acceptance Criteria
- No deprecation warnings from Husky during commits
- Pre-commit runs wiki checker only when wiki files are staged
- Lint-staged still runs normally
- CI green on the PR that introduces the upgrade
Risks/Notes
- husky init may overwrite existing hooks; we should re-apply our conditional logic
- Ensure developers run npm install to pick up the new version
Follow-ups
- Update WARP.md (Dev rules) with short note about Husky v10 hooks style
- Optionally add a small script to verify developers have Husky v10 installed
References
- Our current .husky/pre-commit contains the deprecated husky.sh sourcing lines.
Metadata
Metadata
Assignees
Labels
No labels