mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 04:34:25 +08:00
The only option available to biome's `lsp-proxy` command used for linting is `--config-path`. However, we are using ALE to find and set the project root, and have a way to manually override, so that is no longer necessary. The LSP proxy also used the `g:ale_biome_options` config, which is shared with the fixer's `check` command, but `lsp-proxy` will throw an error if unknown options are included, making it so that option is only useful to set the project root. BREAKING CHANGE: We are no longer passing options to the biome LSP proxy, but we can still set the project root with `g:ale_biome_lsp_project_root`.
44 lines
1.1 KiB
Plaintext
44 lines
1.1 KiB
Plaintext
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:
|
|
call ale#assert#TearDownFixerTest()
|
|
|
|
Execute(The default biome command should be correct):
|
|
call ale#test#SetFilename('../test-files/biome/jsonc/src/test.ts')
|
|
|
|
AssertFixer
|
|
\ {
|
|
\ 'read_temporary_file': 1,
|
|
\ 'command': ale#Escape('biome')
|
|
\ . ' check --apply %t'
|
|
\ }
|
|
|
|
Execute(Unsafe fixes can be applied via an option):
|
|
call ale#test#SetFilename('../test-files/biome/jsonc/src/test.ts')
|
|
let g:ale_biome_fixer_apply_unsafe = 1
|
|
|
|
AssertFixer
|
|
\ {
|
|
\ 'read_temporary_file': 1,
|
|
\ 'command': ale#Escape('biome')
|
|
\ . ' check --apply-unsafe %t'
|
|
\ }
|
|
|
|
Execute(The fixer should accept options):
|
|
call ale#test#SetFilename('../test-files/biome/jsonc/src/test.ts')
|
|
let g:ale_biome_options = '--foobar'
|
|
|
|
AssertFixer
|
|
\ {
|
|
\ 'read_temporary_file': 1,
|
|
\ 'command': ale#Escape('biome')
|
|
\ . ' check --apply --foobar %t',
|
|
\ }
|