config/lvim/ftplugin/javascript.lua (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
lvim.lang.javascript.formatters = {
-- { exe = "eslint_d" },
{ exe = "prettierd" },
}
lvim.lang.javascript.linters = {
{ exe = "eslint_d" },
}
-- Debugger
require("dap-install").config("jsnode", {})
-- Lsp
lvim.lang.javascript.lsp.setup.handlers = {
["textDocument/publishDiagnostics"] = function(_, _, p, client_id, _, config)
if p.diagnostics ~= nil then
local i = 1
while i <= #p.diagnostics do
if p.diagnostics[i].code == 80001 then
table.remove(p.diagnostics, i)
else
i = i + 1
end
end
end
vim.lsp.diagnostic.on_publish_diagnostics(_, _, p, client_id, _, config)
end,
}
|