
Pros
Cons
Lefthook is completely free to use with no hidden costs.
No reviews yet. Be the first to review Lefthook!
Top alternatives based on features, pricing, and user needs.
Lefthook includes a `stage_fixed: true` option within job configurations. When enabled, if a tool like a linter or formatter modifies staged files, Lefthook automatically re-stages those changes before the commit proceeds, ensuring that all fixes are included in the current commit.
Yes, Lefthook supports defining multiple jobs within a single hook, each with its own `glob` pattern. This allows you to specify that `yarn run stylelint` should only run on `*.css` files, while `yarn run eslint` runs on `*.ts`, `*.js`, `*.tsx`, and `*.jsx` files, all within the same `pre-commit` hook.
Yes, Lefthook offers a `parallel: true` option at the hook level. When set, all jobs defined under that hook will execute concurrently, which can significantly reduce the total time required for the hook to complete, especially when dealing with multiple independent tasks.
Lefthook can be installed either as a project dependency, typically via a package manager like npm or Yarn, or globally on your system. The documentation provides instructions for both methods, allowing you to choose the installation scope that best fits your development environment and project requirements.
Source: evilmartians.github.io