https://github.com/benhigham/commitlint-config
My personal commitlint configuration based on the Conventional Commits standard.
https://github.com/benhigham/commitlint-config
changelog commit commitizen commitlint commitlint-config conventional-changelog conventional-commits format lint lint-config rules styleguide
Last synced: 8 months ago
JSON representation
My personal commitlint configuration based on the Conventional Commits standard.
- Host: GitHub
- URL: https://github.com/benhigham/commitlint-config
- Owner: benhigham
- License: mit
- Created: 2025-03-31T03:16:39.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-06-16T13:52:33.000Z (8 months ago)
- Last Synced: 2025-06-22T06:13:48.891Z (8 months ago)
- Topics: changelog, commit, commitizen, commitlint, commitlint-config, conventional-changelog, conventional-commits, format, lint, lint-config, rules, styleguide
- Language: JavaScript
- Homepage:
- Size: 134 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# `@benhigham/commitlint-config`
[](https://www.npmjs.com/package/@benhigham/commitlint-config)
[](https://www.npmjs.com/package/@benhigham/commitlint-config)
[](LICENSE.md)
My personal [commitlint](https://commitlint.js.org) configuration based on the [Conventional Commits](https://www.conventionalcommits.org/) standard.
## Features
- Based on `@commitlint/config-conventional`
- Provides consistent, structured commit messages
- Integrates with Atom-style changelogs
- Pre-configured formatting rules
## Installation
```bash
# npm
npm install --save-dev @benhigham/commitlint-config
# yarn
yarn add --dev @benhigham/commitlint-config
# pnpm
pnpm add --save-dev @benhigham/commitlint-config
```
## Usage
Use in `commitlint.config.js`:
```js
/** @type {import('@commitlint/types').UserConfig} */
const config = {
extends: ['@benhigham/commitlint-config'],
// your overrides here
};
export default config;
```
### With Git Hooks
For the best experience, use with [lefthook](https://github.com/evilmartians/lefthook) or [husky](https://github.com/typicode/husky) to enforce commit message formatting:
#### Example with lefthook
```yaml
# lefthook.yml
commit-msg:
commands:
lint-commit:
run: pnpm exec commitlint --edit {1}
```
#### Example with husky
```bash
# Install husky
npm install --save-dev husky
# Set up the commit-msg hook
npx husky add .husky/commit-msg 'npx commitlint --edit $1'
```
## Commit Message Format
This configuration enforces the [Conventional Commits](https://www.conventionalcommits.org/) format:
```
[(optional scope)]:
[optional body]
[optional footer(s)]
```
### Types
- `feat`: A new feature
- `fix`: A bug fix
- `docs`: Documentation only changes
- `style`: Changes that do not affect the meaning of the code
- `refactor`: A code change that neither fixes a bug nor adds a feature
- `perf`: A code change that improves performance
- `test`: Adding missing tests or correcting existing tests
- `build`: Changes that affect the build system or external dependencies
- `ci`: Changes to CI configuration files and scripts
- `chore`: Other changes that don't modify src or test files
- `revert`: Reverts a previous commit
## Requirements
- Node.js 18.20.x or higher
- [commitlint](https://commitlint.js.org) 19.x
## License
This project is licensed under the [MIT License](LICENSE.md).