https://github.com/nlibjs/lint-commit
https://github.com/nlibjs/lint-commit
git
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/nlibjs/lint-commit
- Owner: nlibjs
- License: apache-2.0
- Created: 2020-10-02T01:06:49.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-07-28T18:09:15.000Z (11 months ago)
- Last Synced: 2025-07-28T20:21:55.406Z (11 months ago)
- Topics: git
- Language: TypeScript
- Homepage:
- Size: 1.93 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE.txt
Awesome Lists containing this project
README
# @nlib/lint-commit
[](https://github.com/nlibjs/lint-commit/actions/workflows/test.yml)
[](https://codecov.io/gh/nlibjs/lint-commit)
Lint your commit messages.
## Message Format
```
CommitMessage = Type ["(" Scope ")"] ": " Subject [EOL Body]
Type = DefaultTypes (or your configuration)
DefaultTypes = "build" | "chore" | "ci" | "docs" | "feat" | "fix" | "perf" |
"refactor" | "revert" | "style" | "test" | "deps" | "breaking"
Scope = DefaultScope (or your configuration)
DefaultScope = /^[\w-]+$/
Subject = /^\S[^\r\n]*$/ (or your configuration)
EOL = /\r\n|\r|\n/
Body =
```
## Usage
Then, set `@nlib/lint-commit` to `commit-msg` hook.
```sh
#!/bin/sh
npx @nlib/lint-commit --input $1
```
[husky]: https://www.npmjs.com/package/husky