mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-20 18:14:33 +08:00
fix(biome): run all enabled biome fixers (#4763)
- based on biome config, will format, lint, and/or sort imports - adds variable to apply unsafe fixes, disabled by default fixes: #4754
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
function! ale#fixers#biome#Fix(buffer) abort
|
||||
let l:executable = ale#handlers#biome#GetExecutable(a:buffer)
|
||||
let l:options = ale#Var(a:buffer, 'biome_options')
|
||||
let l:apply = ale#Var(a:buffer, 'biome_fixer_apply_unsafe') ? '--apply-unsafe' : '--apply'
|
||||
|
||||
return {
|
||||
\ 'read_temporary_file': 1,
|
||||
\ 'command': ale#Escape(l:executable) . ' format'
|
||||
\ 'command': ale#Escape(l:executable) . ' check ' . l:apply
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' %t'
|
||||
\}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
call ale#Set('biome_executable', 'biome')
|
||||
call ale#Set('biome_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
call ale#Set('biome_options', '')
|
||||
call ale#Set('biome_fixer_apply_unsafe', 0)
|
||||
|
||||
function! ale#handlers#biome#GetExecutable(buffer) abort
|
||||
return ale#path#FindExecutable(a:buffer, 'biome', [
|
||||
|
||||
Reference in New Issue
Block a user