@commitlint/cz-commitlint
Version:
Commitizen adapter using the commitlint.config.js
62 lines (44 loc) • 1.62 kB
Markdown
> Commitizen adapter using the commitlint.config.js
This is a commitizen adapter, using this adapter, commitizen works based on commitlint.config.js.
Submit by commitizen, lint by commitlint, just need maintain one configuration file, Consistent and Scalable.
The interactive process is inspired by [cz-conventional-changelog](https://github.com/commitizen/cz-conventional-changelog).
```bash
npm install --save-dev @commitlint/cz-commitlint commitizen inquirer@9
yarn add -D @commitlint/cz-commitlint commitizen inquirer@9
```
In package.json
```json
{
"scripts": {
"commit": "git-cz"
},
"config": {
"commitizen": {
"path": "@commitlint/cz-commitlint"
}
}
}
```
**⚠️ Important: The required version of commitlint and shared configuration is above 12.1.2, update them if already existed in project**
```bash
npm install --save-dev @commitlint/config-conventional @commitlint/cli
yarn add @commitlint/config-conventional @commitlint/cli -D
echo "module.exports = {extends: ['@commitlint/config-conventional']};" > commitlint.config.js
```
```bash
git add .
npm run commit
yarn commit
```
- [Commitlint Reference Prompt](https://commitlint.js.org/reference/prompt) - How to customize prompt information by setting commitlint.config.js