Last active
February 22, 2017 17:46
-
-
Save adamdicarlo/99652d2b588c4a5c3ed7f93253ecdcbf to your computer and use it in GitHub Desktop.
Convert tab-indented JS & JSX to standard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# assumes you have gnu find installed via homebrew (`brew install findutils --with-default-names`) | |
# if you installed without `--with-default-names` then use `gfind` | |
for f in $(/usr/local/bin/find . -regex ".*\\.jsx?" -o -path ./node_modules -prune -a -type f); do | |
sed -e '/\/\/ NPM/d' -i "" $f | |
sed -e 's/ / /g' -i "" $f | |
sed -e "s/return ('')/return ''/g" -i "" $f | |
standard --fix $f | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment