@handy-js/git-cz
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

npm type definitions npm NPM npm GitHub last commit


@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: '新增功能',
  },
};

img.png

Package Sidebar

Install

npm i @handy-js/git-cz

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

25.4 kB

Total Files

6

Last publish

Collaborators

  • yantaolu