Commitlint
ELI5 — The Vibe Check
Commitlint is the grammar police for your commit messages. Try to commit with 'asdf fixed stuff'? Rejected. It enforces Conventional Commits format so your history is clean and tools can parse it. Works with Husky to catch bad messages before they even reach the repo.
Real Talk
Commitlint is a tool that lints commit messages against configurable rules, typically enforcing the Conventional Commits specification. It integrates with Git hooks (via Husky) to validate messages at commit time, ensuring consistent, parseable commit history for automated tooling.
Show Me The Code
// commitlint.config.js
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'scope-enum': [2, 'always', ['api', 'auth', 'ui']],
'subject-max-length': [2, 'always', 72]
}
};
When You'll Hear This
"Commitlint rejected my commit — I forgot the 'feat:' prefix." / "Commitlint + Husky means nobody can push a badly formatted commit message."
Related Terms
Conventional Commits
Conventional Commits is a format for commit messages: 'feat:', 'fix:', 'chore:', 'docs:'.
Git Hooks
Git Hooks are scripts that Git runs at specific moments — before commit, after push, before merge. They're like event listeners for your version control.
Husky
Husky manages Git hooks in your Node.js project. Pre-commit? Pre-push?
Semantic Release
Semantic Release reads your commit messages and automatically figures out the next version number, generates a changelog, and publishes the release.