neovim: add eslint as language server
This commit is contained in:
@@ -18,7 +18,6 @@ null_ls.setup({
|
|||||||
null_formatting.gofmt,
|
null_formatting.gofmt,
|
||||||
null_formatting.goimports,
|
null_formatting.goimports,
|
||||||
null_formatting.shfmt,
|
null_formatting.shfmt,
|
||||||
require("none-ls.diagnostics.eslint"),
|
|
||||||
},
|
},
|
||||||
on_attach = function()
|
on_attach = function()
|
||||||
local group = vim.api.nvim_create_augroup("NullLsLspFormatting", { clear = true })
|
local group = vim.api.nvim_create_augroup("NullLsLspFormatting", { clear = true })
|
||||||
|
|||||||
@@ -123,3 +123,26 @@ vim.lsp.config.emmet_ls = {
|
|||||||
root_markers = { "package.json", ".git", vim.uv.cwd() },
|
root_markers = { "package.json", ".git", vim.uv.cwd() },
|
||||||
}
|
}
|
||||||
vim.lsp.enable("emmet_ls")
|
vim.lsp.enable("emmet_ls")
|
||||||
|
|
||||||
|
-- eslint
|
||||||
|
vim.lsp.config.eslint = {
|
||||||
|
cmd = { "eslint-language-server", "--stdio" },
|
||||||
|
filetypes = {
|
||||||
|
"html",
|
||||||
|
"javascript",
|
||||||
|
"javascript.jsx",
|
||||||
|
"javascriptreact",
|
||||||
|
"typescript",
|
||||||
|
"typescript.tsx",
|
||||||
|
"typescriptreact",
|
||||||
|
},
|
||||||
|
root_markers = {
|
||||||
|
vim.fn.glob(".eslintrc*", 0, 1),
|
||||||
|
vim.fn.glob("eslint.config.*", 0, 1),
|
||||||
|
},
|
||||||
|
settings = {
|
||||||
|
nodePath = "",
|
||||||
|
format = false,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
vim.lsp.enable("eslint")
|
||||||
|
|||||||
Reference in New Issue
Block a user