
Ditch Husky: Speed Up Git Hooks with Lefthook
Originally published at recca0120.github.io Every commit, you wait for ESLint, Prettier, and TypeScript checks to run one by one. Three tools, three times the wait. Lefthook runs them in parallel and cuts that time in half. Why Switch from Husky Husky with lint-staged is the most common Git hooks setup, but it has some real pain points. Scattered configuration : Husky v8 puts hook logic in shell scripts inside .husky/ , while lint-staged rules live in package.json or .lintstagedrc . Understanding what actually happens on commit requires checking multiple files. Node.js startup overhead : Every commit, Husky has to spin up the Node.js runtime before running lint-staged. In large projects, this adds up. Sequential execution : lint-staged runs commands one after another — ESLint finishes, then Prettier starts. All those CPU cores sit idle. Dependency bloat : Husky + lint-staged bring roughly 1,500 dependencies into node_modules . Lefthook solves all four: it's a Go binary with no runtime
Continue reading on Dev.to JavaScript
Opens in a new tab




