Skip to content

Instantly share code, notes, and snippets.

@AvraamMavridis
Created July 23, 2017 05:31
Show Gist options
  • Save AvraamMavridis/21852ccc92c031c5ea831418918e8b04 to your computer and use it in GitHub Desktop.
Save AvraamMavridis/21852ccc92c031c5ea831418918e8b04 to your computer and use it in GitHub Desktop.
prt.sh
for f in $(git diff --name-only); do
if [ ${f: -3} == '.js' ] || [ ${f: -4} == '.jsx' ]; then
$(npm bin)/prettier $f --print-width=120 --single-quote --write
$(npm bin)/eslint --fix $f
fi
if [ ${f: -5} == '.scss' ]; then
$(npm bin)/prettier $f --print-width=120 --single-quote --write
$(npm bin)/cssdeclsort $f
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment