I just started the project and followed the documentation (https://typicode.github.io/husky/#/), where I applied the following steps:
npx husky-init && yarn # Yarn 1
npx husky add .husky/commit-msg 'npx --no-install commitlint --edit "$1"'
After that, I edited the created file, after command (2), looking like this:
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
echo "HOOK PRE-COMMIT"
yarn lint-check
yarn prettier-check
Okay, after that I did two types of tests, which were:
With
prettier
+eslint
applied throughout the project (No error or warning)Without
prettier
+eslint
applied throughout the project (With warning)
And in both tests, when committing the code, I always get the same error below:
What is happening?
I use the following config:
- Ubuntu 20.04 LTS
- VSCode
- Yarn 1.22.11