mirror of
https://github.com/aminnairi/dotfiles.git
synced 2026-09-14 16:52:12 +02:00
disabling auto format on save when eslint is attached to an lsp server
This commit is contained in:
@@ -6,6 +6,7 @@ return {
|
||||
},
|
||||
init = function()
|
||||
local whichKey = require("which-key")
|
||||
local conform = require("conform")
|
||||
|
||||
-- Use LspAttach autocommand to only map the following keys
|
||||
-- after the language server attaches to the current buffer
|
||||
@@ -109,6 +110,8 @@ return {
|
||||
vim.lsp.buf.format({
|
||||
async = true,
|
||||
})
|
||||
|
||||
conform.format({ buffnr = ev.buff })
|
||||
end,
|
||||
"Format file",
|
||||
buffer = ev.buf,
|
||||
@@ -208,12 +211,7 @@ return {
|
||||
|
||||
lspconfig.eslint.setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = function(_, bufnr)
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
buffer = bufnr,
|
||||
command = "EslintFixAll",
|
||||
})
|
||||
end,
|
||||
on_attach = on_attach
|
||||
})
|
||||
|
||||
lspconfig.dockerls.setup({
|
||||
@@ -225,5 +223,10 @@ return {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach
|
||||
})
|
||||
|
||||
lspconfig.intelephense.setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user