disabling auto format on save when eslint is attached to an lsp server

This commit is contained in:
aminnairi
2023-12-04 22:24:34 +01:00
parent eee82aa636
commit 5b92d921f6
@@ -6,6 +6,7 @@ return {
}, },
init = function() init = function()
local whichKey = require("which-key") local whichKey = require("which-key")
local conform = require("conform")
-- Use LspAttach autocommand to only map the following keys -- Use LspAttach autocommand to only map the following keys
-- after the language server attaches to the current buffer -- after the language server attaches to the current buffer
@@ -109,6 +110,8 @@ return {
vim.lsp.buf.format({ vim.lsp.buf.format({
async = true, async = true,
}) })
conform.format({ buffnr = ev.buff })
end, end,
"Format file", "Format file",
buffer = ev.buf, buffer = ev.buf,
@@ -208,12 +211,7 @@ return {
lspconfig.eslint.setup({ lspconfig.eslint.setup({
capabilities = capabilities, capabilities = capabilities,
on_attach = function(_, bufnr) on_attach = on_attach
vim.api.nvim_create_autocmd("BufWritePre", {
buffer = bufnr,
command = "EslintFixAll",
})
end,
}) })
lspconfig.dockerls.setup({ lspconfig.dockerls.setup({
@@ -225,5 +223,10 @@ return {
capabilities = capabilities, capabilities = capabilities,
on_attach = on_attach on_attach = on_attach
}) })
lspconfig.intelephense.setup({
capabilities = capabilities,
on_attach = on_attach
})
end, end,
} }