Add support for prettier for JavaScript

https://prettier.io/
This commit is contained in:
Andrew Vos 2018-02-21 15:16:15 +00:00
parent bfa82d7f99
commit be7a44c2e2

View File

@ -159,6 +159,12 @@ if !exists('g:formatdef_standard_javascript')
let g:formatdef_standard_javascript = '"standard --fix --stdin"' let g:formatdef_standard_javascript = '"standard --fix --stdin"'
endif endif
if !exists('g:formatdef_prettier_javascript')
if filereadable('.prettierrc')
let g:formatdef_prettier_javascript = '"prettier"'
endif
endif
" This is an xo formatter (inspired by the above eslint formatter) " This is an xo formatter (inspired by the above eslint formatter)
" To support ignore and overrides options, we need to use a tmp file " To support ignore and overrides options, we need to use a tmp file
" So we create a tmp file here and then remove it afterwards " So we create a tmp file here and then remove it afterwards
@ -248,7 +254,8 @@ if !exists('g:formatters_javascript')
\ 'jsbeautify_javascript', \ 'jsbeautify_javascript',
\ 'jscs', \ 'jscs',
\ 'standard_javascript', \ 'standard_javascript',
\ 'xo_javascript' \ 'prettier_javascript',
\ 'xo_javascript',
\ ] \ ]
endif endif