From c8bab1be40b72b5002492056f127bb2055c329de Mon Sep 17 00:00:00 2001 From: Manuel Bichler Date: Wed, 2 Dec 2020 14:25:14 +0100 Subject: [PATCH 1/2] add husky v5 example Hi, i just added the husky v5 example. https://typicode.github.io/husky/#/?id=husky_git_params-ie-commitlint- cheers --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 61f11dd344..e78aa1ddbc 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,9 @@ To lint commits before they are created you can use Husky's 'commit-msg' hook. Install in your project `npm install husky --save-dev` or `yarn add -D husky`. -After that, you can create a `.huskyrc` file or add to your `package.json` the following code: +After that, you can create a `.huskyrc` file or add to your `package.json` the following code for + +Husky V4: ```json { @@ -109,6 +111,15 @@ After that, you can create a `.huskyrc` file or add to your `package.json` the f } ``` +Husky V5 +``` +# .husky/pre-commit +# ... +npx --no-install commitlint --edit $1 +# or +yarn commitlint --edit $1 +``` + **Detailed Setup instructions** - [Local setup](https://conventional-changelog.github.io/commitlint/#/guides-local-setup) - Lint messages on commit with husky From 4feb2cff5493369bc63da1fb65800b371e43e3a5 Mon Sep 17 00:00:00 2001 From: hannes Date: Thu, 3 Dec 2020 11:23:05 +0800 Subject: [PATCH 2/2] docs: linting --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e78aa1ddbc..ba335bce23 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ To lint commits before they are created you can use Husky's 'commit-msg' hook. Install in your project `npm install husky --save-dev` or `yarn add -D husky`. -After that, you can create a `.huskyrc` file or add to your `package.json` the following code for +After that, you can create a `.huskyrc` file or add to your `package.json` the following code for Husky V4: @@ -112,6 +112,7 @@ Husky V4: ``` Husky V5 + ``` # .husky/pre-commit # ...