Pre-commit Hook
Noun · Development
Definitions
A Git hook script that runs automatically before a commit is created. Commonly used to run linters, formatters, type checkers, and secret scanners on staged files. If the hook exits with a non-zero status, the commit is aborted. The pre-commit framework standardizes hook management across projects.
In plain English: An automatic check that runs before each commit, rejecting it if the code doesn't meet quality standards.
Example: "The pre-commit hook runs ESLint and Prettier on staged files — if there are lint errors, the commit is rejected until you fix them."