Husky hook とは?
Husky hook とは、プロジェクトで定義したhookをチーム全体で簡単にインストールして共有できるようにするツールである Husky を通じて設定されるGit hookです。pre-commit や pre-push といったライフサイクルのタイミングでスクリプトを実行し、たとえばlint、フォーマット、テストを行います。特定のチェックを、コードが手元を離れる前に開発者のマシンへ前倒しします。
なぜ重要か
フォーマットやコミットメッセージのエラーをローカルで検出するのは、数分後にCIの実行を失敗させるよりもはるかに高速です。Husky は、それらのチェックをチームの全員に対して一貫性のあるバージョン管理された形にします。hookは回避でき、CIが本当のゲートであるため、ローカルのhookはCIを置き換えるのではなく補完します。
関連ガイド
What Is lint-staged?lint-staged runs linters and formatters only on the files staged for commit, making pre-commit checks fast by…
What Is commitlint?commitlint is a tool that checks commit messages against a configured convention, rejecting commits that do n…
What Is a Conventional Changelog?A conventional changelog is a release notes document generated automatically from structured commit messages…