fix(eslint): only run EslintFixAll on buffers where eslint is attached

This commit is contained in:
Folke Lemaitre 2023-03-10 08:54:56 +01:00
parent aa8bae07ae
commit f1dbd097e4
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -14,7 +14,11 @@ return {
setup = {
eslint = function()
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,
},