diff --git a/README.md b/README.md index a6febd5a01..8a8c45ef9e 100644 --- a/README.md +++ b/README.md @@ -40,9 +40,24 @@ npm install --save-dev @commitlint/{config-conventional,cli} echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js ``` + +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) + +```json +{ + "scripts": { + "commitmsg": "commitlint -e $GIT_PARAMS" + } +} +``` + + +**Detailed Setup instructions** + * [Local setup](http://marionebl.github.io/commitlint/#/guides-local-setup) - Lint messages on commit with husky * [CI setup](http://marionebl.github.io/commitlint/#/guides-ci-setup) - Lint messages during CI builds + ## CLI * Primary way to interact with commitlint.