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

This commit is contained in:
Folke Lemaitre committed 2023-03-10 08:54:56 +01:00
1 parent aa8bae07ae
commit f1dbd097e4
1 file changed
+5 -1
@@ -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,
},