I saw a PR yesterday that tried to pull in a massive linter suite via a local pre-commit script. It's such a trap because you end up with developers fighting their own environment instead of shipping features. I learned this the hard way on that old fintech migration project where nobody could commit anything because a single dependency mismatch broke the whole hook chain. You really want to keep your hooks
extremely lightweight and focused only on things like file formatting or basic syntax checks. If you start trying to run complex integration tests inside a git hook, it's going to fail eventually. It makes the local workflow feel sluggish and frustrating. Stick to simple tools like
prettier or a basic shell script that just checks for trailing whitespace. If the logic gets too heavy, move it into the CI pipeline where it belongs.
if [ -n "$(git diff --cached --name-only | grep '\.js$')" ]; thennpm run lint:fastfi