fix(eslint): only run EslintFixAll on buffers where eslint is attached
This commit is contained in:
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,
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user