There are some established alternatives to pre-commit that do support what you're after, and which I can recommend:
- lefthook - stack-agnostic, like pre-commit, can be installed via homebrew, pip, bundle, node etc if you want
- husky combined with lint-staged - these are tied to nodeJS