I am trying to lint my ionic project and abort the commit if lint fails. Running npm run lint
in the console shows the error. I have installed precommit and lately husky ("husky": "^0.15.0-rc.6"
) with the below code inside package.json
"husky": {
"hooks": {
"pre-commit": "npm run lint"
}
}
I have read a number of tutorials and the closest I got is linting but still commits if there are errors. Have also reverted the git hooks. How can I share the modified hooks with a team and run lint on every commit?
At the moment git does commit event though npm run lint
returns errors. I have remote the precommit hooks so the husky installation can successfully set up new ones.
Check out the comments in this GitHub issue. Adding --bailOnLintError true
to lint script did the trick.