-
-
Notifications
You must be signed in to change notification settings - Fork 164
Open
Description
Summary
Upgrade husky from 4.2.5 to 9.x. This is a complete configuration format change — v4 uses package.json hooks, while v9 uses a .husky/ directory with shell scripts.
Current → Target
| Package | Current | Latest |
|---|---|---|
husky |
4.2.5 | 9.1.7 |
Why Upgrade
- v4 is unmaintained and uses a deprecated installation approach
- v9 is faster, simpler, and uses native Git hooks
- Smaller install footprint
Migration Steps
- Remove old husky config from
package.json:// DELETE this block from package.json: "husky": { "hooks": { "pre-commit": "yarn ci" } }
- Install and initialize:
yarn add --dev husky@latest npx husky init
- Create the pre-commit hook:
echo 'yarn ci' > .husky/pre-commit
- Add prepare script to
package.json:"scripts": { "prepare": "husky" }
- Test — make a commit and verify the pre-commit hook runs
yarn ci - Add
.husky/directory to git
Files Affected
package.json— removehusky.hooks, addpreparescript, upgrade dependency.husky/pre-commit— new file with hook script
References
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels