I had tslint running in my pre commit hook for a while now without issue, and I just added stylelint as well. However I noticed that when I added stylelint tslint stopped working. After some digging around I found the order I declare them in the pre-commit file makes a difference.
For example if this is my pre-commit file then failures on ng lint
will be ignored, but failures on npm run stylelint
exit and block the commit.
#!/bin/sh
git pull origin
ng lint
npm run stylelint
Here I flip the order of ng lint and stylelint and I find the behavior is reversed, now failures on stylelint are ignored while failures on ng lint
exit and block the commit.
#!/bin/sh
git pull origin
npm run stylelint
ng lint
How do I write this so that the commit will be blocked when anything in this returns an exit code?