Skip to content

Instantly share code, notes, and snippets.

@tzengerink
Created October 10, 2016 07:44
Show Gist options
  • Save tzengerink/417313bb98ffb879732ba8cd9c22ffc3 to your computer and use it in GitHub Desktop.
Save tzengerink/417313bb98ffb879732ba8cd9c22ffc3 to your computer and use it in GitHub Desktop.
TSLint pre-commit hook
#!/bin/bash
for file in $(git diff --cached --name-only | grep -E '\.ts$')
do
git show ":$file" | tslint "$file"
if [ $? -ne 0 ]; then
exit 1
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment