Skip to content

Commit 063f47d

Browse files
chore: setup commit message linting
1 parent 85da22f commit 063f47d

File tree

5 files changed

+442
-39
lines changed

5 files changed

+442
-39
lines changed

.commitlintrc.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["@commitlint/config-conventional"]
3+
}

.huskyrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"hooks": {
3-
"pre-commit": "lint-staged"
3+
"pre-commit": "lint-staged",
4+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
45
}
56
}

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,11 @@ To learn about ESLint plugin development see the [relevant section](https://esli
291291

292292
In order to know which AST nodes are created for a snippet of TypeScript code you can use [AST explorer](https://astexplorer.net/) with options JavaScript and @typescript-eslint/parser.
293293

294+
### Commit Messages
295+
296+
> tl;dr: use `npx cz` instead of `git commit`.
297+
Commit messages must follow [Conventional Commit messages guidelines](https://www.conventionalcommits.org/en/v1.0.0/). You can use `npx cz` instead of `git commit` to run a interactive prompt to generate the commit message. We've customize the prompt specifically for this project. For more information see [commitizen](https://github.com/commitizen/cz-cli#readme).
298+
294299
## How to publish
295300

296301
```

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@
6363
"escape-string-regexp": "^4.0.0"
6464
},
6565
"devDependencies": {
66+
"@commitlint/cli": "^13.1.0",
67+
"@commitlint/config-conventional": "^13.1.0",
6668
"@istanbuljs/nyc-config-typescript": "^1.0.1",
6769
"@rebeccastevens/eslint-config": "^1.0.12",
6870
"@rollup/plugin-commonjs": "^17.0.0",

0 commit comments

Comments
 (0)