Husky
Git hooks made easy — run linters, tests, or checks automatically before commits and pushes.
Pricing
Free / Open source
Type
Automation
Languages
JavaScript
// VERDICT
Reach for Husky when you want to run lint/format/test checks automatically via Git hooks, catching issues before commit/push. Skip it when you prefer CI-only gating or don't use Git.
Best for
Managing Git hooks easily - running checks (lint, format, tests) automatically on commit/push, so quality gates fire locally before code ever reaches CI.
Avoid when
You don't use Git, you want all gating in CI only, or you dislike client-side hooks.
CI/CD fit
Git hooks (pre-commit/pre-push) · pairs with lint-staged · shifts checks left of CI
Languages
JavaScript
Team fit
Git-based teams · Teams wanting fast local feedback · QA shifting checks left
Setup
Maintenance
Learning
Licence
// BEST FOR
- Running checks automatically on Git commit/push
- Catching lint/format/test issues before CI
- Easy, version-controlled hook setup
- Pairing with lint-staged to check only staged files
- Enforcing standards consistently across a team
- Shifting quality gates left of the pipeline
// AVOID WHEN
- You don't use Git
- You want all gating in CI only
- Client-side hooks are discouraged in your team
- Hooks slowing commits is unacceptable
- You need server-side enforcement (CI is the source of truth)
- Minimal tooling is the goal
// QUICK START
npm install -D husky && npx husky init
# add .husky/pre-commit running: npx lint-staged// ALTERNATIVES TO CONSIDER
| Tool | Choose it when |
|---|---|
| lint-staged | You want to run checks only on staged files (used with Husky). |
| Prettier | You want the formatter that hooks typically run. |
| ESLint | You want the linter that hooks typically run. |
// FEATURES
- Simple shell-script-based Git hooks
- pre-commit, pre-push, commit-msg, and more
- One-time install via husky init
- Monorepo support via custom hook paths
- Native Git hooks under the hood (no shim runtime)
// PROS
- Trivial to set up
- Modern v9+ approach uses plain shell scripts in .husky/
- Works reliably across teams once committed
// CONS
- Adds latency to every commit
- Shell environment quirks on some Windows setups
- Bypassed easily with --no-verify if not paired with CI checks
// EXAMPLE QA WORKFLOW
Install and initialise Husky
Add a pre-commit hook
Run lint-staged (or lint/format/tests) in it
Commit hooks so the team shares them
Keep hooks fast and meaningful
Rely on CI as the authoritative gate