From ae99d6acd6ced44021f9e2aee3263e5bcdea2118 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 23 Apr 2024 05:36:34 +0300 Subject: [PATCH] docs: :memo: add pnpm to the getting started and local setup guides (#4041) --- docs/guides/getting-started.md | 4 ++++ docs/guides/local-setup.md | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/docs/guides/getting-started.md b/docs/guides/getting-started.md index 494e1f268c..2c6bdea9b2 100644 --- a/docs/guides/getting-started.md +++ b/docs/guides/getting-started.md @@ -18,6 +18,10 @@ yarn add --dev @commitlint/{cli,config-conventional} npm install --save-dev @commitlint/config-conventional @commitlint/cli ``` +```sh [pnpm] +pnpm add --save-dev @commitlint/{cli,config-conventional} +``` + ::: ## Configuration diff --git a/docs/guides/local-setup.md b/docs/guides/local-setup.md index 1a55cb4877..8f8cadf97c 100644 --- a/docs/guides/local-setup.md +++ b/docs/guides/local-setup.md @@ -62,6 +62,24 @@ echo "yarn commitlint \${1}" > .husky/commit-msg > [!WARNING] > 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) +== pnpm + +```sh +pnpm add --save-dev husky + +pnpm husky init + +# Add commit message linting to commit-msg hook +echo "pnpm dlx commitlint --edit \$1" > .husky/commit-msg +``` + +As an alternative you can create a script inside `package.json` + +```sh +npm pkg set scripts.commitlint="commitlint --edit" +echo "pnpm commitlint \${1}" > .husky/commit-msg +``` + ::: ---