English / 简体中文
@itaober/commitlint
provides a set of predefined Commitlint configurations to help standardize commit messages and supports command-line prompt suggestions.
pnpm install @itaober/commitlint -D
Refer to the Commitlint official configuration documentation.
/** @type {import("@itaober/commitlint").UserConfig} */
export default {
extends: ['@itaober/commitlint'],
// Add your custom configurations here
};
/** @type {import("@itaober/commitlint").UserConfig} */
module.exports = {
extends: ['@itaober/commitlint'],
// Add your custom configurations here
};
Validate commit messages against commitlint rules before each commit. Follow these steps:
- Install the dependencies
pnpm add simple-git-hooks -D
- Add the following code to your
package.json
{
"simple-git-hooks": {
"commit-msg": "npx --no-install commitlint --edit $1"
}
}
@itaober/commitlint
includes @commitlint/cz-commitlint
and commitizen
, supporting command-line prompt suggestions for commit messages. To enable this feature, follow these steps:
- Add the following code to your
package.json
{
"scripts": {
"cz": "git-cz"
},
"config": {
"commitizen": {
"path": "@commitlint/cz-commitlint"
}
}
}
- After
git add
, runpnpm cz
to create a commit message with prompt suggestions.
See the CHANGELOG.md.