Git hooks with Husky - No bad commits any more

preview_player
Показать описание
In this video you are going to learn how to bind Prettier to pre-commit hooks with Husky.

So there will no bad formatted code get committed. You can do a lot more and bind more script and command to different hooks.

What are Git hooks?
Git hooks are scripts that Git executes before or after events such as: commit, push, and receive. Git hooks are a built-in feature - no need to download anything. Git hooks are run locally.
Рекомендации по теме
Комментарии
Автор

Super simple and straight-forward! Thanks for doing this with a somewhat bare-boned project for it to be easily understood.

chrislyonm
Автор

Thanks, I thought it would be way more complicated :D

zermax
Автор

How we can do same it :
$ git commit -m"pre"
husky > pre-commit (node v16.18.0)
Stashing changes... [started]
Stashing changes... [completed]
Running linters... [started]
Running tasks for *.{js, json, css, md} [started]

nope
Автор

can not worked correctly for me
$ git commit -m"pre"
[test_husky 78efad1] pre
3 files changed, 5415 insertions(+), 1266 deletions(-)

nope