Well I still don't get it.
I have followed the how to do
"scripts": {
"lint-staged": "lint-staged",
"precommit": "lint-staged"
},
"lint-staged": {
"*.{js,ts,tsx}": [
"standard --fix",
"tslint --fix",
"git add",
"jest --bail"
]
},
... and it's quite working. What I still missing is the tests
✔ Running tasks for *.{js,ts,tsx}
[0.1.11 7a1daa8] testing
1 file changed, 4 insertions(+)
it says okay, but not all tests have ran. I don't want to run only for the committed files, I want run all.
What am I missing here?
lint-staged deals with staged files. If you want to test all files, change your pre-commit hook command to lint-staged && jest --bail and remove jest --bail from lint-staged commands
I don't know what I was thinking.
Thank you.
Most helpful comment
lint-stageddeals with staged files. If you want to test all files, change your pre-commit hook command tolint-staged && jest --bailand removejest --bailfromlint-stagedcommands