The approach some JS projects have taken is to use Husky, which automatically sets up the git hooks when you install the project's dependencies during development.