Files
ale/test/linter/test_biome.vader
Braden Kelley ed0b036220 fix(biome): find root when using biome.jsonc (#4774)
Since biome supports either `biome.json` or `biome.jsonc` config files,
we need to look for both when searching for the LSP project root. We can
also look for a package.json or .git folder to use. This uses mostly the
same logic as deno.
2024-06-25 17:18:28 +09:00

55 lines
1.6 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(The biome command should accept options):
let g:ale_biome_options = '--foobar'
AssertLinter 'biome', ale#Escape('biome') . ' lsp-proxy --foobar'
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 '/'