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 = {
|
||||
tsserver = {},
|
||||
denols = {},
|
||||
eslint = {},
|
||||
lua_ls = {
|
||||
Lua = {
|
||||
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({
|
||||
root_dir = lspconfig.util.root_pattern("package.json"),
|
||||
on_attach = function(client, bufnr)
|
||||
|
|
|
@ -139,9 +139,9 @@ return {
|
|||
null_ls.setup({
|
||||
sources = {
|
||||
null_ls.builtins.diagnostics.codespell,
|
||||
require("none-ls.diagnostics.eslint_d").with({
|
||||
method = null_ls.methods.DIAGNOSTICS_ON_SAVE,
|
||||
}),
|
||||
-- require("none-ls.diagnostics.eslint_d").with({
|
||||
-- method = null_ls.methods.DIAGNOSTICS_ON_SAVE,
|
||||
-- }),
|
||||
null_ls.builtins.diagnostics.stylelint.with({
|
||||
filetypes = { "scss", "css" },
|
||||
}),
|
||||
|
|
Loading…
Reference in New Issue