feat: prettier for astro
This commit is contained in:
parent
c88bddfa83
commit
6b9148feee
|
@ -152,7 +152,7 @@ let s:default_registry = {
|
|||
\ },
|
||||
\ 'prettier': {
|
||||
\ 'function': 'ale#fixers#prettier#Fix',
|
||||
\ 'suggested_filetypes': ['javascript', 'typescript', 'css', 'less', 'scss', 'json', 'json5', 'graphql', 'markdown', 'vue', 'svelte', 'html', 'yaml', 'openapi', 'ruby'],
|
||||
\ 'suggested_filetypes': ['javascript', 'typescript', 'css', 'less', 'scss', 'json', 'json5', 'graphql', 'markdown', 'vue', 'svelte', 'html', 'yaml', 'openapi', 'ruby', 'astro'],
|
||||
\ 'description': 'Apply prettier to a file.',
|
||||
\ },
|
||||
\ 'prettier_eslint': {
|
||||
|
|
|
@ -79,6 +79,7 @@ function! ale#fixers#prettier#ApplyFixForVersion(buffer, version) abort
|
|||
\ 'openapi': 'yaml',
|
||||
\ 'html': 'html',
|
||||
\ 'ruby': 'ruby',
|
||||
\ 'astro': 'astro',
|
||||
\}
|
||||
|
||||
for l:filetype in l:filetypes
|
||||
|
|
|
@ -293,6 +293,20 @@ Execute(Should set --parser based on first filetype of multiple filetypes):
|
|||
\ . ' --stdin-filepath %s --stdin',
|
||||
\ }
|
||||
|
||||
Execute(Should set --parser based on first filetype of multiple filetypes):
|
||||
call ale#test#SetFilename('../test-files/prettier/testfile')
|
||||
|
||||
set filetype=astro
|
||||
|
||||
GivenCommandOutput ['1.6.0']
|
||||
AssertFixer
|
||||
\ {
|
||||
\ 'cwd': '%s:h',
|
||||
\ 'command': ale#Escape(g:ale_javascript_prettier_executable)
|
||||
\ . ' --parser astro'
|
||||
\ . ' --stdin-filepath %s --stdin',
|
||||
\ }
|
||||
|
||||
Execute(Should set --parser for experimental language, Handlebars):
|
||||
call ale#test#SetFilename('../test-files/prettier/testfile.hbs')
|
||||
|
||||
|
|
Loading…
Reference in New Issue