@6river/commitlint-config-6river 中文文档教程
@6river/commitlint-config-6river
6 River Systems commitlint
配置。
commitlint
是一种检查提交消息是否符合常规提交 规范的工具。 标准化的提交消息对于版本控制和变更日志的自动化很有用。
Installation
以下说明使用 Husky 作为提交挂钩。
npm install --save-dev @commitlint/cli husky @6river/commitlint-config-6river
配置 commitlint
的最简单方法是在 package.json
中:
"commitlint": {
"extends": [
"@6river/commitlint-config-6river"
]
}
您也可以使用独立文件 commitlint.config.js
:
module.exports = {extends: ['@6river/commitlint-config-6river']}
如果您已经拥有.husky/commit-msg
中的预提交挂钩,将此行添加到其中:
npx commitlint --edit $1
如果您没有文件 .husky/commit-msg
,请运行以下命令创建它:
npx husky add .husky/commit-msg "npx commitlint --edit $1"
git add .husky/commit-msg
有关详细信息,请参阅commitlint
文档。
@6river/commitlint-config-6river
6 River Systems commitlint
configuration.
commitlint
is a tool that checks commit messages for conformance to the conventional commits specification. Standardized commit messages are useful for automation of versioning and changelogs.
Installation
The following instructions use Husky for commit hooks.
npm install --save-dev @commitlint/cli husky @6river/commitlint-config-6river
The simplest way to configure commitlint
is in package.json
:
"commitlint": {
"extends": [
"@6river/commitlint-config-6river"
]
}
You can also use a standalone file commitlint.config.js
:
module.exports = {extends: ['@6river/commitlint-config-6river']}
If you already have a pre-commit hook in .husky/commit-msg
, add this line to it:
npx commitlint --edit $1
If you do not have the file .husky/commit-msg
, run the following to create it:
npx husky add .husky/commit-msg "npx commitlint --edit $1"
git add .husky/commit-msg
For more information, see the commitlint
documentation.