fix: eslint

This commit is contained in:
Garrett Dawson 2024-05-23 23:06:46 -06:00
parent 1363b4f077
commit 78c926131c
2 changed files with 16 additions and 3 deletions

View File

@ -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)

View File

@ -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" },
}),