My lsp.lua
is as follows:
local util = require("lspconfig.util")
return {
{
"williamboman/mason.nvim",
opts = function(_, opts)
vim.list_extend(opts.ensure_installed, {
"biome",
"stylua",
"selene",
"luacheck",
"shellcheck",
"shfmt",
"tailwindcss-language-server",
"typescript-language-server",
"css-lsp",
})
end,
},
{
"neovim/nvim-lspconfig",
opts = {
--- other options
servers = {
tsserver = {
on_attach = function(client)
client.server_capabilities.documentFormattingProvider = false
end,
},
biome = {
cmd = { "biome", "lsp-proxy" },
filetypes = {
"javascript",
"javascriptreact",
"json",
"jsonc",
"typescript",
"typescript.tsx",
"typescriptreact",
"astro",
"svelte",
"vue",
"css",
},
root_dir = util.root_pattern("biome.json"),
},
},
},
},
}
So in my project, I have a biome.json
which I have configured to follow the formatting and linting we are using in our project (we migrated from eslint and prettier). This seems to work fine for my fellow colleagues who are using VSCode. For me, however, I use neovim in my daily work, so I can’t seem to make it follow biome.json
configuration and hence resulting in different formatting everytime I save a file. What is it I’m missing here?