title: tslint precommit hook shows all the linting errors before but also allows to commit the code
body: <p>I am using angular-seed &amp; husky to add a precommit hook for git. My package.json has</p>
  
  <pre><code>"scripts": {
      "precommit": "npm test &amp;&amp; npm run lint",
    }
  </code></pre>
  
  <p>When I commit the code, husky runs "npm test" &amp; "npm run lint" fine. When npm test fails, it shows me the errors on the console &amp; doesn't allow me to commit. But when there are errors on "npm run lint" then the console displays all the error messages but also allows to commit. How can avoid the commit to when there are linting errors? Any help is appreciated. Thank you in advance!
  This is how my .git\hooks\pre-commit looks:</p>
  
  <pre><code>#!/bin/sh
  #husky 0.14.3
  
  command_exists () {
    command -v "$1" &gt;/dev/null 2&gt;&amp;1
  }
  
  has_hook_script () {
    [ -f package.json ] &amp;&amp; cat package.json | grep -q "\"$1\"[[:space:]]*:"
  }
  
  cd "."
  
  # Check if precommit script is defined, skip if not
  has_hook_script precommit || exit 0
  
  # Node standard installation
  export PATH="$PATH:/c/Program Files/nodejs"
  
  # Check that npm exists
  command_exists npm || {
    echo &gt;&amp;2 "husky &gt; can't find npm in PATH, skipping precommit script in package.json"
    exit 0
  }
  
  # Export Git hook params
  export GIT_PARAMS="$*"
  
  # Run npm script
  echo "husky &gt; npm run -s precommit (node `node -v`)"
  echo
  
  npm run -s precommit || {
    echo
    echo "husky &gt; pre-commit hook failed (add --no-verify to bypass)"
    exit 1
  }
  </code></pre>