@handy-js/git-cz
v1.0.1
Published
Commitizen adapter like `git-cz` using the `commitlint.config.js`
Downloads
3
Maintainers
Readme
@handy-js/git-cz
Adapter for commitizen and author commit messages that adhere to the commit convention configured in commitlint.config.js
.
Install commitlint
$ npm install @commitlint/cli --save-dev
Install peer Dependencies
$ npm install commitizen inquirer@8 --save-dev
Install
$ npm install @handy-js/git-cz --save-dev
or
$ yarn add @handy-js/git-cz -D
or
$ pnpm add @handy-js/git-cz -D
Config commitizen
in package.json
{
"config": {
"commitizen": {
"path": "@handy-js/git-cz"
}
}
}
Custom config
You can provide a custom configuration in a commitlint
config file like commitlint.config.js
.
module.exports = {
// original commitlint config
extends: ['@handy-js/git-cz/lib/config'],
// extra config
format: '{type}{scope}: {emoji}{subject}', // => 'fix(scope): 🐛 fix xxx'
// config type list to select
types: ['build', 'chore', 'ci', 'docs', 'feat', 'fix', 'perf', 'refactor', 'revert', 'style', 'test'],
// config scopes to select
scopes: [],
// enable emoji
useEmoji: true,
// if rule can skip
skips: ['scope'],
// custom question description
questionDescriptions: {
type: '选择您要提交的变更类型',
},
// custom type enum description
typeEnumDescriptions: {
feat: '新增功能',
},
};