See https://pre-commit.com
I think it's a matter of specifying a .pre-commit-hooks.yaml file in the root of the repo, then it becomes available as:
- repo: https://github.com/keithamus/sort-package-json
rev: v3.0.0
hooks:
- id: sort-package-json
Links: