Answer the question
In order to leave comments, you need to log in
How to force husky to make changes before the commit and not after?
In my package.json file I have the following code:
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"src/**/*.+(tsx|ts|scss)": [
"prettier --write",
"git add ."
]
},
Answer the question
In order to leave comments, you need to log in
I have these settings:
{
"scripts": {
"precommit": "lint-staged"
},
"lint-staged": {
"src/**/*.{ts,tsx}": [
"prettier --write",
"tslint --fix",
"git add"
]
}
}
Had the same problem.
Solution: Changed the environment in which git runs and git itself:
was:
environment: cygwin64 ( https://cygwin.com/install.html)
git version: 2.17.0
now:
environment: mingw64 ( https://git- scm.com/download/win)
git version: 2.18.0.windows.1
another configs:
win10x64
node -v 10.14.1
npm -v 6.7.0
"husky": "^2.1.0",
"lint-staged" : "^6.1.1",
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question