fix: eslint
This commit is contained in:
parent
1363b4f077
commit
78c926131c
13
init.lua
13
init.lua
|
@ -483,6 +483,7 @@ require('which-key').register({
|
||||||
local servers = {
|
local servers = {
|
||||||
tsserver = {},
|
tsserver = {},
|
||||||
denols = {},
|
denols = {},
|
||||||
|
eslint = {},
|
||||||
lua_ls = {
|
lua_ls = {
|
||||||
Lua = {
|
Lua = {
|
||||||
workspace = { checkThirdParty = false },
|
workspace = { checkThirdParty = false },
|
||||||
|
@ -526,6 +527,18 @@ lspconfig.denols.setup({
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
lspconfig.eslint.setup {
|
||||||
|
root_dir = lspconfig.util.root_pattern('.eslintrc', '.eslintrc.js', '.eslintrc.json'),
|
||||||
|
settings = {
|
||||||
|
format = { enable = true },
|
||||||
|
},
|
||||||
|
handlers = {
|
||||||
|
['window/showMessageRequest'] = function(_, result)
|
||||||
|
return result.message:match('ENOENT') and vim.NIL or result
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
lspconfig.tsserver.setup({
|
lspconfig.tsserver.setup({
|
||||||
root_dir = lspconfig.util.root_pattern("package.json"),
|
root_dir = lspconfig.util.root_pattern("package.json"),
|
||||||
on_attach = function(client, bufnr)
|
on_attach = function(client, bufnr)
|
||||||
|
|
|
@ -139,9 +139,9 @@ return {
|
||||||
null_ls.setup({
|
null_ls.setup({
|
||||||
sources = {
|
sources = {
|
||||||
null_ls.builtins.diagnostics.codespell,
|
null_ls.builtins.diagnostics.codespell,
|
||||||
require("none-ls.diagnostics.eslint_d").with({
|
-- require("none-ls.diagnostics.eslint_d").with({
|
||||||
method = null_ls.methods.DIAGNOSTICS_ON_SAVE,
|
-- method = null_ls.methods.DIAGNOSTICS_ON_SAVE,
|
||||||
}),
|
-- }),
|
||||||
null_ls.builtins.diagnostics.stylelint.with({
|
null_ls.builtins.diagnostics.stylelint.with({
|
||||||
filetypes = { "scss", "css" },
|
filetypes = { "scss", "css" },
|
||||||
}),
|
}),
|
||||||
|
|
Loading…
Reference in New Issue