Wednesday, June 5, 2024
 Popular · Latest · Hot · Upcoming
193
rated 0 times [  196] [ 3]  / answers: 1 / hits: 151417  / 6 Years ago, thu, april 26, 2018, 12:00:00

prettier is not running on precommit. This worked with the same configuration in other projects, so I'm baffled why it's not working this time.



This is the relevant section of my package.json file:



scripts: {
precommit: lint-staged
},
lint-staged: {
*.{js,json,css,scss,html,md}: [
prettier --write,
git add
]
},


Edit. Here are the relevant devDependencies:



devDependencies: {
husky: ^0.14.3,
lint-staged: ^7.0.4,
prettier: 1.12.0
},

More From » git

 Answers
6

Reinstalled husky and now seems to be working. Thanks @mpasko256 for your help!


[#54567] Monday, April 23, 2018, 6 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
patriciakiarrac

Total Points: 532
Total Questions: 100
Total Answers: 89

Location: Ivory Coast
Member since Sun, Mar 7, 2021
3 Years ago
patriciakiarrac questions
;