Skip to content

Commit

Permalink
chore: setup commit message linting
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaStevens committed Aug 3, 2021
1 parent 3def1cc commit 1f26cca
Show file tree
Hide file tree
Showing 5 changed files with 442 additions and 39 deletions.
3 changes: 3 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["@commitlint/config-conventional"]
}
3 changes: 2 additions & 1 deletion .huskyrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"hooks": {
"pre-commit": "lint-staged"
"pre-commit": "lint-staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,11 @@ To learn about ESLint plugin development see the [relevant section](https://esli

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.

### Commit Messages

> tl;dr: use `npx cz` instead of `git commit`.
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).

## How to publish

```
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
"escape-string-regexp": "^4.0.0"
},
"devDependencies": {
"@commitlint/cli": "^13.1.0",
"@commitlint/config-conventional": "^13.1.0",
"@istanbuljs/nyc-config-typescript": "^1.0.1",
"@rebeccastevens/eslint-config": "^1.0.12",
"@rollup/plugin-commonjs": "^17.0.0",
Expand Down
Loading

0 comments on commit 1f26cca

Please sign in to comment.