npm install commitlint-config-cz --save-dev Usage Extend your commitlint config byczincommitlint.config.js. module.exports={extends:['other-config','cz']}; Modules & API commitlint-config-cz includes some module
安装cz-git的前提是已经安装过commitizen,前面已经安装了这里就不在赘述 pnpm add cz-git-D 配置package.json "scripts":{"commit":"git add -A && git-cz"}"config":{"commitizen":{"path":"node_modules/cz-git"}} 配置模板 cz-git给出了一些推荐配置模板:https://cz-git.qbb.sh/zh/config/,我们...
// commitlint.config.jsmodule.exports={// 继承第三方库的配置extends:['cz'],rules:{// 自定义规则,},}; 根目录下新建.cz-config.js文件,这个文件和上个文件是用来配置提交时候的信息,以减轻我们的心智负担。 代码语言:javascript 代码运行次数:0 运行 AI代码解释 // .cz-config.jsmodule.exports={types...
/** @type {import('cz-git').UserConfig} */ const fs = require('fs') const path = require('path') /* 获取项目的修改范围 */ const scopes = fs .readdirSync(path.resolve(__dirname, 'src'), { withFileTypes: true }) ...
背景:commitizen的交互方式可能不适合所有人,因此国内开发者开发了czgit。优势:czgit提供了更符合国人习惯的交互性和更高的自定义性。配置:通过安装czgit并配置package.json和czgit.config.cjs,可以进一步优化提交流程。其他工具推荐:VSCode插件:对于喜欢简洁的开发者,VSCode的gitcommitplugin插件也是一...
"scripts":{"commit":"git add -A && git-cz"}"config":{"commitizen":{"path":"node_modules/cz-git"}} 配置模板cz-git给出了一些推荐配置模板:https://cz-git.qbb.sh/zh/config/,我们在之前的commitlint.config.cjs文件上,进行修改 由于配置中含有图案,上传可能导致错误,需要源代码的,可以到https:...
安装cz-conventional-changelog依赖包 保存依赖包版本到package.json文件的devDependencies 添加the config.commitizen key到package.json文件中, 内容如下: //package.json{//..."config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}}} ...
首先需要安装commitizen和commitlint-config-cz和cz-customizable npm install commitizen commitlint-config-cz cz-customizable --save -D 然后新建.cz-config.js文件,内容如下: 'use strict'module.exports= {types: [ {value:'feat',name:'新增:新增功能、页面'}, ...
本地会新建一个配置文件commitlint.config.js 配置husky Husky 会新建一个 Hook, 随后可以详细设置一下所需要的 Hooks:详细配置 husky Hooks 配置commitizen 并设置 cz 作为工具 安装完毕之后可以使用yarn commit来调用 cz 以实现格式化 commit 安装lint-staged 以配置 pre commit hook 进行检查 ...
2.在根元素新增commitlint.config.js 增加.cz-config.js 'use strict'; module.exports = { types: [ { value: '✨新增', name: '新增: 新的内容' }, { value: '🐛修复', name: '修复: 修复一个Bug' }, { value: '📝文档', name: '文档: 变更的只有文档' }, { value: '💄格式',...