https://github.com/remarkablemark/husky-commitlint-demo
Demo of how to lint Git commit messages with commitlint and husky.
https://github.com/remarkablemark/husky-commitlint-demo
commitlint git githook husky npm
Last synced: 2 months ago
JSON representation
Demo of how to lint Git commit messages with commitlint and husky.
- Host: GitHub
- URL: https://github.com/remarkablemark/husky-commitlint-demo
- Owner: remarkablemark
- License: mit
- Created: 2021-02-15T20:08:37.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-02-28T05:35:22.000Z (over 1 year ago)
- Last Synced: 2025-02-14T08:45:54.192Z (4 months ago)
- Topics: commitlint, git, githook, husky, npm
- Homepage: https://b.remarkabl.org/3u0Vdlc
- Size: 59.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# husky-commitlint-demo
[](https://github.com/remarkablemark/husky-commitlint-demo/actions/workflows/commitlint.yml)
Demo of how to lint Git commit messages with [commitlint](https://b.remarkabl.org/commitlint) and [husky](https://b.remarkabl.org/husky).
Read [blog post](https://b.remarkabl.org/3u0Vdlc) or watch [YouTube video](https://youtu.be/2J9VnYiZ_Ts?list=PLVgOtoUBG2mdLpj6qT5DXfg5_pGPTDrJZ).
## Prerequisites
- [Node.js](https://b.remarkabl.org/nodejs-site)
## Install
Clone repository:
```sh
git clone https://github.com/remarkablemark/husky-commitlint-demo.git
cd husky-commitlint-demo
```Install dependencies:
```sh
npm install
```## husky
Enable Git hooks:
```sh
npx husky
```Add the `commit-msg` hook:
```sh
echo 'npx commitlint --edit $1' > .husky/commit-msg
```## package.json
Private package:
```json
{
"private": true,
"scripts": {
"prepare": "husky"
},
"devDependencies": {
"@commitlint/cli": "latest",
"@commitlint/config-conventional": "latest",
"husky": "latest"
}
}
```Public package:
```json
{
"private": false,
"scripts": {
"prepare": "husky"
},
"devDependencies": {
"@commitlint/cli": "latest",
"@commitlint/config-conventional": "latest",
"husky": "latest"
}
}
```## License
[MIT](LICENSE)