draco.devdraco.dev
AI 导航
工具包
关于我
⌘ K

Table of Contents

安装
npm
使用
方法一
方法二
lint-staged 配置
husky 配置
设置 commit-msg
设置 pre-commit
使用 git-cz
工具包
commitlint
eslint
markdownlint
prettier
stylelint
tsconfig
下一篇
eslint

Community

Report Bug

Help

GitHub
Open-source MIT Licensed - Powered by Draco
文档
更新日志

@draco-china/commitlint

本包提供了《Git 规约》配套的 commitlint 可共享配置,用于对 git commit message 进行校验。

安装

除了本包,你需要同时安装 husky 和 lint-staged:

npm

bash

使用

方法一

在你的 package.json 中继承本包:

json

方法二

在你的 commitlint.config.js 中继承本包:

javascript

lint-staged 配置

在你的 package.json 中:

json

在你的 .lintstagedrc 中:

json

husky 配置

设置 commit-msg

bash

设置 pre-commit

bash

使用 git-cz

在你的 package.json 中:

json

更多信息可参考 commitlint 文档。