local M = {} return { { "mfussenegger/nvim-lint", event = "LazyFile", opts = { -- Event to trigger linters events = { "BufWritePost", "BufReadPost", "InsertLeave" }, linters_by_ft = { }, -- NOTE: LazyVim had an extension to support global and fallback linters, -- and conditionally enable a linter }, config = function(_, opts) function M.debounce(ms, fn) local timer = vim.uv.new_timer() return function(...) local argv = { ... } timer:start(ms, 0, function() timer:stop() vim.schedule_wrap(fn)(unpack(argv)) end) end end local lint = require('lint') function M.lint() lint.try_lint() end vim.api.nvim_create_autocmd(opts.events, { group = vim.api.nvim_create_augroup("nvim-lint", { clear = true }), callback = M.debounce(100, M.lint), }) end, }, }