diff --git a/lua/lazyvim/plugins/extras/linting/eslint.lua b/lua/lazyvim/plugins/extras/linting/eslint.lua index 92c670d4..fd860f9b 100644 --- a/lua/lazyvim/plugins/extras/linting/eslint.lua +++ b/lua/lazyvim/plugins/extras/linting/eslint.lua @@ -10,7 +10,7 @@ return { "neovim/nvim-lspconfig", -- other settings removed for brevity opts = { - ---@type lspconfig.options + ---@type table servers = { eslint = { settings = { @@ -26,10 +26,6 @@ return { return end - local function get_client(buf) - return vim.lsp.get_clients({ name = "eslint", bufnr = buf })[1] - end - local formatter = LazyVim.lsp.formatter({ name = "eslint: lsp", primary = false, @@ -37,24 +33,6 @@ return { filter = "eslint", }) - -- Use EslintFixAll on Neovim < 0.10.0 - if not pcall(require, "vim.lsp._dynamic") then - formatter.name = "eslint: EslintFixAll" - formatter.sources = function(buf) - local client = get_client(buf) - return client and { "eslint" } or {} - end - formatter.format = function(buf) - local client = get_client(buf) - if client then - local diag = vim.diagnostic.get(buf, { namespace = vim.lsp.diagnostic.get_namespace(client.id) }) - if #diag > 0 then - vim.cmd("EslintFixAll") - end - end - end - end - -- register the formatter with LazyVim LazyVim.format.register(formatter) end,