I installed husky@4
and lint-staged
as per many other projects (on Mac OS11). The terminal command flow git add .
and git commit -m 'something'
flow works fine: Husky's pre-commit hook and lint-staged
commands are picked up successfully. However, the Github Desktop pre-commit hook does not seem to be behaving.
I have tried looking in the the .git/hooks/pre-commit
file and it's there:
#!/bin/sh
# husky
# Created by Husky v4.3.8 (https://github.com/typicode/husky#readme)
# At: 3/7/2021, 12:09:26 PM
# From: /Users/admin/devProj/prject/node_modules/husky (https://github.com/typicode/husky#readme)
. "$(dirname "$0")/husky.sh"
Commands:
...
"husky": "^4.3.8",
"lint-staged": "^10.5.4",
...
"husky": {
"hooks": {
"pre-commit": "tsc --noEmit && lint-staged"
}
},
"lint-staged": {
"**/*.(js|jsx|ts|tsx)": [
"npm run lint:fix",
"prettier --write"
]
}
Any other reasons why GitHub Desktop is not finding this?
yarn
is installed. Mine was installed in my user directory. – Pickmeup