Skip to content

Latest commit

 

History

History

docs

Lint commit messages

Demo generated with svg-term-cli

commitlint   slack

npm latest CircleCI

commitlint helps your team adhering to a commit convention. By supporting npm-installed configurations it makes sharing of commit conventions easy.

Getting started

Install

npm install -g @commitlint/cli @commitlint/config-conventional

Configure

echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js

Test

# Lint from stdin
echo 'foo: bar' | commitlint
⧗   input: foo: bar
✖   type must be one of [build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test] [type-enum]

✖   found 1 problems, 0 warnings
ⓘ   Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint
# Lint last commit from history
commitlint --from=HEAD~1

?> To get the most out of commitlint you'll want to automate it in your project lifecycle. See our Local setup guide for next steps.

Documentation

  • Guides - Common use cases explained in a step-by-step pace
  • Concepts - Overarching topics important to understand the use of commitlint
  • Reference - Mostly technical documentation

Attributions

  • commitlint is possible because of the hard work of the folks of the conventional-changelog project
  • Thanks @markusoelhafen for providing the commitlint icon