1.0.0 • Published 9 months ago
@itaober/commitlint-config v1.0.0
@itaober/commitlint-config
English | 简体中文
Introduction
@itaober/commitlint-config provides a set of predefined commitlint rules and configurations to help maintain consistent commit message standards.
Installation
pnpm add @commitlint/cli @itaober/commitlint-config -DUsage
Please refer to the Commitlint Official Configuration Documentation.
Create a commitlint.config.js or commitlint.config.ts configuration file in your project root directory:
export default {
extends: ['@itaober/commitlint-config'],
// custom configurations
};Commit Message Validation with Git Hooks
To automatically check commit messages before they are created, you can use this configuration with simple-git-hooks:
- Install the required packages:
pnpm add simple-git-hooks lint-staged -D- Add the following config to your
package.json:
{
"simple-git-hooks": {
"commit-msg": "npx --no-install commitlint --edit $1"
}
}- Add simple-git-hooks initialization to the prepare script in
package.json:
"scripts": {
"prepare": "simple-git-hooks"
}- Run
pnpm prepareto initialize simple-git-hooks:
pnpm prepareRules
This configuration enforces the following commit message format:
type(scope?): subject
body?
footer?Example:
git commit -m "feat: add new feature"Types
init: Initial commitfeat: A new featurefix: A bug fixdocs: Documentation only changesstyle: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)refactor: A code change that neither fixes a bug nor adds a featureperf: A code change that improves performancetest: Adding missing tests or correcting existing testsbuild: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)chore: Other changes that don't modify src or test filesrevert: Reverts a previous commitrelease: Create a release commit
License
1.0.0
9 months ago
0.1.0-alpha.1
9 months ago