From e2897f24a550f6c09b9cb46c77008fa929b208bd Mon Sep 17 00:00:00 2001 From: willparsons Date: Mon, 29 Jan 2024 01:17:05 +0000 Subject: [PATCH] fix(biome)!: make biome only run in projects with biome.json file (#2984) 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. --- lua/lspconfig/server_configurations/biome.lua | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lua/lspconfig/server_configurations/biome.lua b/lua/lspconfig/server_configurations/biome.lua index d8f144e642..dc1d1ab5fb 100644 --- a/lua/lspconfig/server_configurations/biome.lua +++ b/lua/lspconfig/server_configurations/biome.lua @@ -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 = [[ @@ -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')]], }, }, }