Javascript prettier filetype detect fix (#1769)

Support fixing YAML and HTML files with prettier for files without file extensions.
This commit is contained in:
Paul Reimer
2018-08-02 12:20:19 -07:00
committed by w0rp
parent 649934230b
commit cb8ad9fbd8
2 changed files with 29 additions and 4 deletions

View File

@@ -222,6 +222,20 @@ Execute(Should set --parser based on filetype, Vue):
\ },
\ ale#fixers#prettier#ApplyFixForVersion(bufnr(''), ['1.6.0'])
Execute(Should set --parser based on filetype, YAML):
call ale#test#SetFilename('../prettier-test-files/testfile')
set filetype=yaml
AssertEqual
\ {
\ 'command': 'cd ' . ale#Escape(expand('%:p:h')) . ' && '
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --parser yaml'
\ . ' --stdin-filepath %s --stdin',
\ },
\ ale#fixers#prettier#ApplyFixForVersion(bufnr(''), ['1.6.0'])
Execute(Should set --parser based on first filetype of multiple filetypes):
call ale#test#SetFilename('../prettier-test-files/testfile')