From 9ffaaf89d36b54631615aaf3a0ebb6eea30b6c5b Mon Sep 17 00:00:00 2001 From: Amine Sadry Date: Sun, 2 Jul 2023 12:23:49 +0200 Subject: [PATCH] docs: add instructions to use the package installed locally --- README.md | 7 +++++++ docs/guides-local-setup.md | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/README.md b/README.md index de2d12b495..cb7336725d 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,13 @@ yarn husky install npx husky add .husky/commit-msg 'npx --no -- commitlint --edit ${1}' ``` +**Or use installed package instead** +``` +npm pkg set scripts.commitlint="commitlint --edit" +npx husky add .husky/commit-msg 'npm run commitlint ${1}' +``` + + Check the [husky documentation](https://typicode.github.io/husky/#/?id=manual) on how you can automatically have Git hooks enabled after install for different `yarn` versions. **Detailed Setup instructions** diff --git a/docs/guides-local-setup.md b/docs/guides-local-setup.md index 5c94c6d8d7..2814c2b15e 100644 --- a/docs/guides-local-setup.md +++ b/docs/guides-local-setup.md @@ -43,6 +43,12 @@ yarn husky install npx husky add .husky/commit-msg 'npx --no -- commitlint --edit ${1}' ``` +**Or use installed package instead** +``` +npm pkg set scripts.commitlint="commitlint --edit" +npx husky add .husky/commit-msg 'npm run commitlint ${1}' +``` + **Please note that currently @commitlint/cli doesn't support yarn v2 Plug'n'Play (using yarn v2 with `nodeLinker: node-modules` in your .yarnrc.yml file may work sometimes)**\ Check the [husky documentation](https://typicode.github.io/husky/#/?id=manual) on how you can automatically have Git hooks enabled after install for different `yarn` versions.