commitlint + semantic-release Config
Generate commitlint.config.js, .releaserc.json and a husky commit-msg hook for releases driven by conventional commits. Choose branches, plugins, header length and allowed scopes.
Use the tool
Why this tool exists
Automated releases work only if every commit message follows the same convention, so a tool can decide the next version from them. That needs two pieces that must agree: commitlint to check messages, and semantic-release to read them and publish.
Set the release branches and tick the plugins you need: changelog, npm publish, the git plugin to commit release files and GitHub releases. Add a maximum header length and, if you want to restrict them, allowed scopes. The tool outputs the commitlint config extending the conventional preset, the release configuration with the right plugins in order, and the husky hook line. You still need to install the packages and set tokens such as GITHUB_TOKEN and NPM_TOKEN in your CI. Nothing is uploaded.
How to use it
- Enter the release branches, for example main.
- Tick the plugins you want: changelog, npm, git and GitHub releases.
- Set the maximum header length and any allowed scopes.
- Save each part in its file, install the packages and add the husky hook.
Frequently asked questions
What do I need to install?
@commitlint/cli and @commitlint/config-conventional, husky, semantic-release and the plugins you ticked, such as @semantic-release/changelog and @semantic-release/git. Run them in CI with the right tokens.
How does semantic-release choose a version?
From commit types: fix gives a patch release, feat a minor one and a breaking change marker a major one. Other types such as chore do not trigger a release.
What does the git plugin do?
It commits files changed by the release, such as CHANGELOG.md and package.json, back to the repository with a skip ci message to avoid loops.
What are allowed scopes?
A list of names that may appear in parentheses after the type, like feat(api). If you set them, commitlint rejects other scopes. Leave the field empty to allow any.