From d82cbd4a14dd0b1a3926c7845164a2c2714e2276 Mon Sep 17 00:00:00 2001 From: Gregor Adams Date: Thu, 21 Dec 2017 14:58:30 +0100 Subject: [PATCH] docs: add setup instructions to readme (#202) the npm-script recomendation is available in the readme. (previously hard to find) --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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.