CI Perf Lint

prefer-lefthook-for-complex-git-hooks

What it flags

Flags repositories whose Git hook setup looks moderately complex and may be easier to maintain with Lefthook.

This rule is intentionally conservative. A single lightweight pre-commit command should not trigger it.

Why it matters

For simple hooks, moving away from Husky or lint-staged is often unnecessary.

For multi-step hooks, multiple hook types, or lint-staged setups with several patterns and commands, shell-based hook orchestration can become harder to maintain. Lefthook can provide a cleaner place to manage that complexity and may reduce startup or sequencing overhead in more complex setups.

Current heuristic

The rule looks for repository-level signals such as:

It does not fire for a simple single-hook, single-command setup.

When to ignore it

Ignore this finding when:

Suggested verification

Sources