English | 中文文档
commitlint-wizardoc is a configuration package for commitlint that contain some rules and plugins to check that your commit message conform to the Wizardoc
convention.
If you have never used commitlint before, you can visit commitlint document for more detail.
You can install commitlint-wizardoc
using NPM and YARN as well.
# NPM
npm i commitlint-config-wizardoc -D
# YARN
yarn add commitlint-config-wizardoc -D
Create a commitlint config in the root path of your project, and you can extends the wizardoc
config to do all configuration work.
For instance, create .commitlintrc.js
that looks like:
module.exports = {
// This line config will read the NPM package named "commitlint-config-wizardoc", so please make sure you have installed it before config this line.
extends: "wizardoc",
};
Now, that's all you need to do.
The commit message should consists of four parts:
![Feat::scope] some sentence
^ ^ ^ ^
| | | |
| | | |
| | | |- Subject(required)
| | |
| | |- Scope(optional)
| |
| |- Type(required)
|
|- Break change symbol(optional)
Break change symbol
: it can indicate that the commit contains break changeType
: commit type that can only be one of the following types- Feat
- Init
- Remove
- Delete
- Update
- Refactor
- Move
- Perf
- Doc
- Add
- Patch
- Fix
- Test
- Stub
- Chore
Scope
: scope of modificationSubject
: description of the commit
You can also override Wizardoc
config to create your own configuration as well.
module.exports = {
extends: 'wizardoc',
rules: [
// Set the $ as the third parameter if you wanna change break symbol to $
"break-change-prefix": [2, "always", '$'],
]
}
MIT.