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

This commit is contained in:
Bill Mill authored and James Long committed 2017-04-14 11:16:17 -04:00
1 parent ad637d0744
commit 306870a2a0
1 file changed
+1 -1
+1 -1
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)