Last active
May 5, 2017 12:33
-
-
Save esamattis/7e9511cbd2ec806c5f8a6f96428352c2 to your computer and use it in GitHub Desktop.
prettier with project specific configs https://github.com/jlongster/prettier/issues/98#issuecomment-280060325
This file contains hidden or 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/sh | |
opts="" | |
while true; do | |
if [ -f .prettieropts ]; then | |
opts=$(cat .prettieropts) | |
break | |
fi | |
if [ "$(pwd)" = "/" ]; then | |
break | |
fi | |
cd .. | |
done | |
exec prettier $opts $@ |
This file contains hidden or 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
" for neoformat https://github.com/sbdchd/neoformat | |
let g:neoformat_javascript_prettier = { | |
\ 'exe': 'prettier-config', | |
\ 'args': ['--stdin'], | |
\ 'stdin': 1, | |
\ } | |
let g:neoformat_enabled_javascript = ['prettier'] | |
autocmd BufWritePre *.js exe ":Neoformat" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment