Skip to content

Commit

Permalink
fix(biome)!: make biome only run in projects with biome.json file (#2984
Browse files Browse the repository at this point in the history
)

Closes #2980

This PR adjusts the configuration for the biome LSP to only attach if there is an existing biome.json found.

This helps prevent conflicts in ESLint projects since biome would attach and start providing diagnostics and would format files which could conflict with the ESLint/Prettier rules that are defined.
  • Loading branch information
willparsons authored Jan 29, 2024
1 parent 55cff4b commit e2897f2
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions lua/lspconfig/server_configurations/biome.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,8 @@ return {
'typescript.tsx',
'typescriptreact',
},
root_dir = function(fname)
return util.find_package_json_ancestor(fname)
or util.find_node_modules_ancestor(fname)
or util.find_git_ancestor(fname)
end,
single_file_support = true,
root_dir = util.root_pattern 'biome.json',
single_file_support = false,
},
docs = {
description = [[
Expand All @@ -30,7 +26,7 @@ npm install [-g] @biomejs/biome
```
]],
default_config = {
root_dir = [[root_pattern('package.json', 'node_modules', '.git', 'biome.json')]],
root_dir = [[root_pattern('biome.json')]],
},
},
}

0 comments on commit e2897f2

Please sign in to comment.