match jsx files in pre-commit hook (#1276)

master
Bill Mill 2017-04-14 11:16:17 -04:00 committed by James Long
parent ad637d0744
commit 306870a2a0
1 changed files with 1 additions and 1 deletions

View File

@ -187,7 +187,7 @@ Alternately you can just save this script as `.git/hooks/pre-commit` and give it
```bash
#!/bin/sh
jsfiles=$(git diff --cached --name-only --diff-filter=ACM | grep '\.js$' | tr '\n' ' ')
jsfiles=$(git diff --cached --name-only --diff-filter=ACM | grep '\.jsx\?$' | tr '\n' ' ')
[ -z "$jsfiles" ] && exit 0
diffs=$(node_modules/.bin/prettier -l $jsfiles)