From 499efd17927ca26e9dcdae58e4cc0772b45bbea8 Mon Sep 17 00:00:00 2001 From: Fauzan Date: Fri, 10 Dec 2021 09:32:13 +0700 Subject: [PATCH] fix(docs): minor changes to guides (#2913) * fix(docs): missing for windows command sync with README.md * docs: add missing add hook alternative * docs: add other add hooks commands add hooks produce different result in different command interpreter --- README.md | 9 +++++++++ docs/guides-local-setup.md | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/README.md b/README.md index 9031892ff5..237088d6b4 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,15 @@ yarn husky install # Add hook npx husky add .husky/commit-msg 'npx --no -- commitlint --edit "$1"' +# Sometimes above command doesn't work in some command interpreters +# You can try other commands below to write npx --no -- commitlint --edit $1 +# in the commit-msg file. +npx husky add .husky/commit-msg \"npx --no -- commitlint --edit '$1'\" +# or +npx husky add .husky/commit-msg "npx --no -- commitlint --edit $1" + +# or +yarn husky add .husky/commit-msg 'yarn commitlint --edit $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. diff --git a/docs/guides-local-setup.md b/docs/guides-local-setup.md index 968e141814..169f13fafd 100644 --- a/docs/guides-local-setup.md +++ b/docs/guides-local-setup.md @@ -12,6 +12,10 @@ configure `commitlint` to use it. ```bash # Install and configure if needed npm install --save-dev @commitlint/{cli,config-conventional} +# For Windows: +npm install --save-dev @commitlint/config-conventional @commitlint/cli + +# Configure commitlint to use conventional config echo "module.exports = { extends: ['@commitlint/config-conventional'] };" > commitlint.config.js ```