I'm adding some precommit and prepush scripts to my project. I'm using Husky because it keeps tracked on git any change.
On my package.json I have:
"precommit": "npm run lint && npm run test",
Which initially seems to be working fine, when any test or lint error was found I was unable to make the commit.
Now I found that if I have a warning, the commit happens anyway.
How can I configure Husky, or maybe ESLint, to stop the commit when there are warnings?
I know I could override all eslint configs to be always error [2], but I'm expecting there is something better
You need specify --max-warnings
param.
Something like this:
"scripts": {
...
"lint": "eslint \"**/*.js\" --max-warnings=0",
...
},
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With