Reputation: 363
I've configured prettier and pre-commit hook like before but in my new project husky doesn't run before any commit!
Below is part of the project package.json
file:
{
...,
"devDependencies": {
"husky": "^4.3.6",
"prettier": "2.2.1",
"pretty-quick": "^3.1.0"
},
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged"
}
}
}
Upvotes: 8
Views: 12063
Reputation: 2763
In pre-commit, use npm in front of pretty-quick
npx pretty-quick --staged
Upvotes: 4
Reputation: 975
you should use "husky": "^2.7.0", "prettier": "^1.18.2", "pretty-quick": "^1.11.1",
Upvotes: -2
Reputation: 61
I was running into the same problem but i'm using husky ^5.0.9
.
Then i read the docs that you need to run npx husky install
.
That fixed it for me
Upvotes: 6