semantic-release-commits-lint
raw JSON → 1.1.0 verified Fri May 01 auth: no javascript
semantic-release plugin that analyzes commit messages using commitlint. Works with semantic-release >=20 and commitlint configurations. Provides analyzeCommits step. Version 1.1.0 adds support for commitlintFile and commitlintConfig options. Requires Node >=18 and peer dependencies jest, semantic-release, and xo. Alternative to built-in commit message analysis with custom commitlint rules.
Common errors
error Error: Cannot find module 'semantic-release-commits-lint' ↓
cause Plugin not installed or not in node_modules.
fix
Run npm install semantic-release-commits-lint --save-dev
error TypeError: Cannot read properties of undefined (reading 'analyzeCommits') ↓
cause Using import or require incorrectly.
fix
Use string in plugins array, not imported symbol.
Warnings
gotcha Plugin requires commitlint configuration to be present; otherwise, it may silently pass. ↓
fix Ensure commitlint config file exists or pass commitlintConfig option.
deprecated Deprecated: peer dependency xo may not be maintained. ↓
fix Check xo repository for alternative or compatibility.
breaking Plugin only supports Node >=18. Older Node versions cause runtime errors. ↓
fix Upgrade Node to v18 or later.
Install
npm install semantic-release-commits-lint yarn add semantic-release-commits-lint pnpm add semantic-release-commits-lint Imports
- default wrong
require('semantic-release-commits-lint')correctplugins: ['semantic-release-commits-lint'] - analyzeCommits wrong
import { analyzeCommits } from 'semantic-release-commits-lint'correct// Not exported; plugin provides step internally - options wrong
["semantic-release-commits-lint", { commitlintConfig: { extends: [] } }]correct["semantic-release-commits-lint", { commitlintFile: ".commitlintrc.json" }]
Quickstart
// .releaserc
{
"plugins": [
"semantic-release-commits-lint"
]
}