Add eslint LSP feat: Add linter support with 'nvim-lint' Add linting to JavaScript / TypeScript and Go files
17 lines
450 B
Lua
17 lines
450 B
Lua
return {
|
|
on_attach = function(_, bufnr)
|
|
-- Format document on save
|
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
|
buffer = bufnr,
|
|
callback = function()
|
|
-- check that biome lsp is running
|
|
local biome = vim.lsp.get_clients({ buffer = bufnr, name = "biome" })
|
|
if #biome == 0 then
|
|
vim.lsp.buf.format()
|
|
else
|
|
vim.lsp.buf.format({ filter = function(client) return client.name == "biome" end })
|
|
end
|
|
end,
|
|
})
|
|
end
|
|
}
|