Updated config

Signed-off-by: Taken <taken@mairimashita.org>
This commit is contained in:
2024-02-29 23:26:13 +01:00
parent a59fdc4cad
commit 6f9bbc1c8d
3 changed files with 12 additions and 6 deletions

View File

@@ -30,6 +30,17 @@ return {
}) })
end end
lspconfig["eslint"].setup({
capabilities = capabilities,
on_attach = function(client, bufnr)
on_attach(client, bufnr)
vim.api.nvim_create_autocmd("BufWritePre", {
buffer = bufnr,
command = "EslintFixAll",
})
end,
})
lspconfig["lua_ls"].setup({ lspconfig["lua_ls"].setup({
capabilities = capabilities, capabilities = capabilities,
on_attach = on_attach, on_attach = on_attach,

View File

@@ -23,6 +23,7 @@ return {
"pyright", "pyright",
"powershell_es", "powershell_es",
"jsonls", "jsonls",
"eslint"
}, },
automatic_installation = true, automatic_installation = true,
}) })
@@ -30,7 +31,6 @@ return {
mason_null_ls.setup({ mason_null_ls.setup({
ensure_installed = { ensure_installed = {
"stylua", "stylua",
"eslint_d",
}, },
automatic_installation = true, automatic_installation = true,
}) })

View File

@@ -12,11 +12,6 @@ return {
null_ls.setup({ null_ls.setup({
sources = { sources = {
formatting.stylua, formatting.stylua,
diagnostics.eslint_d.with({
condition = function(utils)
return utils.root_has_file({ ".eslintrc.js" })
end,
}),
}, },
on_attach = function(client, bufnr) on_attach = function(client, bufnr)