Skip to content

Commit d82cbd4

Browse files
pixelassmarionebl
authored andcommitted
docs: add setup instructions to readme (#202)
the npm-script recomendation is available in the readme. (previously hard to find)
1 parent 1de2af7 commit d82cbd4

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

+15
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,24 @@ npm install --save-dev @commitlint/{config-conventional,cli}
4040
echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js
4141
```
4242

43+
44+
To lint commits before they are created you can use the 'commitmsg' hook as described [here](https://github.com/typicode/husky/blob/master/HOOKS.md#hooks)
45+
46+
```json
47+
{
48+
"scripts": {
49+
"commitmsg": "commitlint -e $GIT_PARAMS"
50+
}
51+
}
52+
```
53+
54+
55+
**Detailed Setup instructions**
56+
4357
* [Local setup](http://marionebl.github.io/commitlint/#/guides-local-setup) - Lint messages on commit with husky
4458
* [CI setup](http://marionebl.github.io/commitlint/#/guides-ci-setup) - Lint messages during CI builds
4559

60+
4661
## CLI
4762

4863
* Primary way to interact with commitlint.

0 commit comments

Comments
 (0)