You can use Husky to improve your git commits (and more) by linting your commit messages, running tests, linting code, etc. It automates the process of adding hooks, so when the project dependencies are installed, Husky makes sure that all the hooks will be installed in your local machine.
Git hooks are scripts that run automatically every time a particular event occurs in a Git repository.
(from Atlassian tutorial on Git Hooks)