Skip to content

Tech

Pre-commit hooks with Husky

Introduction

Keeping code consistent and tested gets harder the more people touch a repo, and sooner or later some unlinted code or a failing test slips through. Husky heads that off by running linting, formatting, and tests automatically before a commit lands. This note sets up pre-commit hooks with Husky and lint-staged in a fresh NestJS project.