{
"nvimdev/guard.nvim",
config = function()
-- code
local ft = require("guard.filetype")
---- use stylua to format lua files and no linter
ft("lua"):fmt({
cmd = "stylua",
args = { "-" },
stdin = true,
ignore_error = true,
})
ft("javascript"):fmt({
cmd = "eslint",
args = { "--fix" },
-- args = { "--fix", vim.api.nvim_buf_get_name(0) },
fname = true,
-- fname = vim.api.nvim_buf_get_name(0),
})
require("guard").setup({
-- the only option for the setup function
fmt_on_save = true,
})
end,
},
not work
guard: require("guard.health").check()
- ERROR Failed to run healthcheck for "guard" plugin. Exception:
function health#check, line 25
Vim(eval):E5108: Error executing lua ...i/.local/share/nvim/lazy/guard.nvim/lua/guard/health.lua:56: attempt to call field 'start' (a nil value)
stack traceback:
...i/.local/share/nvim/lazy/guard.nvim/lua/guard/health.lua:56: in function 'check'
[string "luaeval()"]:1: in main chunk
not work