https://github.com/initdc/hello-commitlint
https://github.com/initdc/hello-commitlint
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/initdc/hello-commitlint
- Owner: initdc
- License: mit
- Created: 2021-12-19T10:06:31.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-02-20T13:58:44.000Z (about 4 years ago)
- Last Synced: 2025-10-30T00:49:46.299Z (5 months ago)
- Language: HTML
- Homepage: https://github.com/initdc/commitlint-template
- Size: 132 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# [hello-commitlint](https://github.com/initdc/hello-commitlint)
> It's time to style commit msg.
## Reason
A good coding style-guide takes your project further.
## Use template
```sh
# replace proj
git clone https://github.com/initdc/commitlint-template.git proj
cd proj && rm -rf .git && git init
pnpm init
```
## Install
```sh
pnpm add -D husky prettier lint-staged @commitlint/{config-conventional,cli,prompt-cli} standard-version conventional-github-releaser
echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js
pnpm husky install
pnpm husky add .husky/pre-commit 'pnpm lint-staged'
pnpm husky add .husky/commit-msg 'pnpm commitlint --edit $1'
```
## Pre-defined scripts
```json
"lint-staged": {
"*": "prettier -wu ."
},
"scripts": {
"commit": "commit",
"fmt:c": "prettier -cu .",
"fmt:w": "prettier -wu .",
"rel": "standard-version --help",
"rel:d": "standard-version --dry-run",
"rel:d:as": "standard-version --dry-run --release-as",
"rel:d:m": "standard-version --dry-run --release-as major",
"rel:d:n": "standard-version --dry-run --release-as minor",
"rel:d:p": "standard-version --dry-run --release-as patch",
"rel:v": "standard-version",
"rel:v:as": "standard-version --release-as",
"rel:v:m": "standard-version --release-as major",
"rel:v:n": "standard-version --release-as minor",
"rel:v:p": "standard-version --release-as patch",
"pub:g": "conventional-github-releaser -v",
"pub:n": "npm publish",
"postinstall": "pnpm husky install"
},
```
## Thanks
[commitlint](https://github.com/conventional-changelog/commitlint)
[standard-version](https://github.com/conventional-changelog/standard-version)
[husky](https://github.com/typicode/husky)
[lint-staged](https://github.com/okonet/lint-staged)