mirror of
https://github.com/dense-analysis/ale
synced 2025-01-13 10:32:52 +00:00
a0ad5f938a
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`.
50 lines
1.4 KiB
Plaintext
50 lines
1.4 KiB
Plaintext
Before:
|
|
Save g:ale_biome_options
|
|
Save g:ale_biome_lsp_project_root
|
|
|
|
let g:ale_biome_options = ''
|
|
let g:ale_biome_lsp_project_root = ''
|
|
|
|
call ale#assert#SetUpLinterTest('typescript', 'biome')
|
|
call ale#test#SetFilename('test.ts')
|
|
|
|
After:
|
|
call ale#assert#TearDownLinterTest()
|
|
|
|
Execute(The default biome command should be correct):
|
|
AssertLinter 'biome', ale#Escape('biome') . ' lsp-proxy'
|
|
|
|
Execute(Uses the filetype as the language):
|
|
call ale#test#SetFilename('test.ts')
|
|
set filetype=typescript
|
|
AssertLSPLanguage 'typescript'
|
|
|
|
call ale#test#SetFilename('test.tsx')
|
|
set filetype=typescriptreact
|
|
AssertLSPLanguage 'typescriptreact'
|
|
|
|
call ale#test#SetFilename('test.js')
|
|
set filetype=javascript
|
|
AssertLSPLanguage 'javascript'
|
|
|
|
call ale#test#SetFilename('test.jsx')
|
|
set filetype=javascriptreact
|
|
AssertLSPLanguage 'javascriptreact'
|
|
|
|
Execute(Should find project root containing biome.json):
|
|
call ale#test#SetFilename('../test-files/biome/json/src/test.ts')
|
|
|
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/biome/json')
|
|
|
|
Execute(Should find project root containing biome.jsonc):
|
|
call ale#test#SetFilename('../test-files/biome/jsonc/src/test.ts')
|
|
|
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/biome/jsonc')
|
|
|
|
Execute(Should use user-specified project root):
|
|
let g:ale_biome_lsp_project_root = '/'
|
|
|
|
call ale#test#SetFilename('../test-files/biome/jsonc/src/test.ts')
|
|
|
|
AssertLSPProject '/'
|