mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-16 01:07:06 +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,4 +1,10 @@
|
||||
Before:
|
||||
Save g:ale_biome_options
|
||||
Save g:ale_biome_fixer_apply_unsafe
|
||||
|
||||
let g:ale_biome_options = ''
|
||||
let g:ale_biome_fixer_apply_unsafe = 0
|
||||
|
||||
call ale#assert#SetUpFixerTest('typescript', 'biome')
|
||||
|
||||
After:
|
||||
@@ -11,6 +17,16 @@ Execute(The default biome command should be correct):
|
||||
\ {
|
||||
\ 'read_temporary_file': 1,
|
||||
\ 'command': ale#Escape('biome')
|
||||
\ . ' format %t'
|
||||
\ . ' check --apply %t'
|
||||
\ }
|
||||
|
||||
Execute(Unsafe fixes can be applied via an option):
|
||||
call ale#test#SetFilename('../test-files/typescript/test.ts')
|
||||
let g:ale_biome_fixer_apply_unsafe = 1
|
||||
|
||||
AssertFixer
|
||||
\ {
|
||||
\ 'read_temporary_file': 1,
|
||||
\ 'command': ale#Escape('biome')
|
||||
\ . ' check --apply-unsafe %t'
|
||||
\ }
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
Before:
|
||||
Save g:ale_biome_options
|
||||
|
||||
let g:ale_biome_options = ''
|
||||
|
||||
call ale#assert#SetUpLinterTest('typescript', 'biome')
|
||||
call ale#test#SetFilename('test.ts')
|
||||
|
||||
@@ -9,6 +13,6 @@ Execute(The default biome command should be correct):
|
||||
AssertLinter 'biome', ale#Escape('biome') . ' lsp-proxy'
|
||||
|
||||
Execute(The biome command should accept options):
|
||||
let b:ale_biome_options = '--foobar'
|
||||
let g:ale_biome_options = '--foobar'
|
||||
|
||||
AssertLinter 'biome', ale#Escape('biome') . ' lsp-proxy --foobar'
|
||||
|
||||
Reference in New Issue
Block a user