mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-12 18:34:36 +02:00
fix(eslint): only run EslintFixAll on buffers where eslint is attached
This commit is contained in:
parent
aa8bae07ae
commit
f1dbd097e4
1 changed files with 5 additions and 1 deletions
|
@ -14,7 +14,11 @@ return {
|
||||||
setup = {
|
setup = {
|
||||||
eslint = function()
|
eslint = function()
|
||||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
command = "EslintFixAll",
|
callback = function(event)
|
||||||
|
if require("lspconfig.util").get_active_client_by_name(event.buf, "eslint") then
|
||||||
|
vim.cmd("EslintFixAll")
|
||||||
|
end
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue