commitlint checks whether commit messages follow conventional commit rules. Teams use it locally with git hooks or in CI for consistent history.
Overview
commitlint validates git commit messages against configurable rules, with conventional commit formatting as the common pattern. Message types such as build, chore, ci, docs, feat, fix, perf, refactor, revert, style, and test appear in the default conventional preset, and teams can override types through configuration.
The primary interface is a CLI installed as a development dependency. Configuration is loaded from several supported commitlint config file names, a commitlint field in package.json, or shared npm packages that follow the commitlint-config naming pattern. Shared presets include conventional, Angular, Lerna scopes, Nx scopes, and others.
Beyond the CLI, programmatic packages format reports, lint strings, load shared config, and read commits from a range or last edit. Integrations include commitizen adapters and hooks such as husky for linting at commit time. Guides cover local setup, CI integration, rules reference, and shareable configs.
The tool ties into conventional-changelog workflows for generating changelogs from structured commit history. commitlint is stable and widely used as a development quality gate rather than a hosted service.
Key features
- Conventional commit validation
- Shareable npm configurations
- Multiple config file formats
- CLI and programmatic lint APIs
- Husky and CI integration paths
- commitizen adapter support
- conventional-changelog integration
- Configurable rule sets
Use cases
- Enforcing team commit conventions
- Linting messages in CI pipelines
- Standardizing changelog inputs
- Sharing org-wide commit rules via npm