bids-validator
bids-validator copied to clipboard
How to use git hooks (husky)
We have a pre-commit hook in one of the config files in this repo: https://github.com/bids-standard/bids-validator/blob/54046c1e5624af95baa414833f96e2b70d02ca0f/bids-validator/package.json#L81-L84
I would like to use it, but I am a bit confused how to install it.
- I usually install this package via
npm ci
(clean-install) - However, that only installs the
devDependencies
in the rootpackage.json
, not those ofbids-validator/package.json
- Yet, the hook dependency (husky) is listed under
bids-validator/package.json
What would be the correct workflow to "switch on" the pre-commit hooks?
(I am mostly interested in automatically applying the linter with an autofix at each commit)