A lightweight Husky hook that runs multiple checks in parallel with a live terminal spinner.
- Runs checks in parallel
- Live spinner for running checks
- Individual execution times
- Clear pass/fail output
- Fails the hook if any check fails
- Handles
Ctrl+Cgracefully - No external dependencies
- Uses POSIX
sh
Copy the hook into your project's Husky directory:
cp hook .husky/<hook>
chmod +x .husky/<hook>Make sure Husky is already configured in your project.
Edit the CHECKS variable in hook to define the checks you want to run:
CHECKS="
ESLint|pnpm lint
TypeScript|pnpm typecheck
Tests|pnpm test:changed
"Each line follows this format:
Name|command
For example:
CHECKS="
Lint|pnpm lint
Typecheck|pnpm typecheck
Unit Tests|pnpm test
Build|pnpm build
"All checks are started in parallel.
While checks are running:
Checks
────────────────────────────────────────
⠋ ESLint checking...
⠋ TypeScript checking...
⠋ Tests checking...
When completed:
Checks
────────────────────────────────────────
✓ ESLint passed (4s)
✗ TypeScript failed (2s)
└──> Run: pnpm typecheck
✓ Tests passed (3s)
────────────────────────────────────────
Total: 4s
If a check fails, the hook exits with a non-zero status and prevents the push.
- Git
- Husky
- A POSIX-compatible shell
- The commands configured in
CHECKS
Expected to work on:
- Linux (tested ✅)
- macOS
- Windows with Git for Windows
MIT
