Closed rhyskoedijk closed 4 days ago
I'm not a big fan of pre-commit hooks, but they can save lives.
@mburumaxwell, if you'd like, I can disable the husky init script from the npm prepare event so that it's disabled by default; contributors that want it can just initialise it themselves.
Sounds ideal
Git hooks will be disabled by default after https://github.com/tinglesoftware/dependabot-azure-devops/pull/1472
Adds pre-commit git hooks (via husky) to run prettier and codespell. This removes the need for contributors to manually run
npm run format
andcodespell
prior to commit, it now just happens automatically and will reject the commit if either commands fail.pretty-quick
is used to run prettier on the changed staged files only rather than all files, which keeps the command time to less than a second.Example of a commit containing formatting and spelling errors:
The formatting is automatically updated, but commit is rejected due to typo.
Additionally, running
npm install
from the root directory will also triggernpm install
in the/extension
folder too.