From f24a94048ae3c1bc8777fd310c69752d6040bd8a Mon Sep 17 00:00:00 2001 From: Badisi Date: Mon, 9 Sep 2024 20:40:22 +0200 Subject: [PATCH] fix(husky): auto-fixed lint files are staged after commit --- .husky/commit-msg | 4 ---- .husky/pre-commit | 5 ++++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.husky/commit-msg b/.husky/commit-msg index 00be935..49100d8 100755 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -1,7 +1,3 @@ printf "> Validating commit message... " npx --no -- commitlint --edit "$1" printf "OK\n" - -printf "> Linting staged files... " -npx --no -- lint-staged --quiet -printf "OK\n" diff --git a/.husky/pre-commit b/.husky/pre-commit index 33fa600..7185f2f 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,5 +1,4 @@ printf "> Validating user email... " - gitUserEmail="$(git config user.email)" if [[ $gitUserEmail =~ ^.*@(hcuge|hug).ch$ ]] ; then printf "\n" @@ -12,3 +11,7 @@ if [[ $gitUserEmail =~ ^.*@(hcuge|hug).ch$ ]] ; then else printf "OK\n" fi + +printf "> Linting staged files... " +npx --no -- lint-staged --quiet +printf "OK\n"