fix(biome): use temp file instead of stdin (#4775)

biome handles utf8 characters differently between files and stdin, and
in some cases can replace emojis with ascii characters when using stdin

refs: biomejs/biome#2604
This commit is contained in:
Braden Kelley 2024-06-20 16:19:55 -07:00 committed by GitHub
parent c7c41e1574
commit 0cd64c87bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -3,8 +3,9 @@ function! ale#fixers#biome#Fix(buffer) abort
let l:options = ale#Var(a:buffer, 'biome_options') let l:options = ale#Var(a:buffer, 'biome_options')
return { return {
\ 'read_temporary_file': 1,
\ 'command': ale#Escape(l:executable) . ' format' \ 'command': ale#Escape(l:executable) . ' format'
\ . (!empty(l:options) ? ' ' . l:options : '') \ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' --stdin-file-path=%s', \ . ' %t'
\} \}
endfunction endfunction

View File

@ -9,7 +9,8 @@ Execute(The default biome command should be correct):
AssertFixer AssertFixer
\ { \ {
\ 'read_temporary_file': 1,
\ 'command': ale#Escape('biome') \ 'command': ale#Escape('biome')
\ . ' format --stdin-file-path=%s' \ . ' format %t'
\ } \ }