mirror of
https://github.com/aminnairi/dotfiles.git
synced 2026-09-14 18:02:13 +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()
|
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,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user