return { { "nvim-lint", event = { "BufReadPre", "BufNewFile" }, for_cats = "core.general", after = function() local lint = require("lint") lint.linters_by_ft = { python = { "ruff" }, go = { "golangcilint" }, rust = { "clippy" }, c = { "clangtidy" }, cpp = { "clangtidy" }, java = { "checkstyle" }, cmake = { "cmakelint" }, javascript = { "eslint_d" }, typescript = { "eslint_d" }, } local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true }) vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost" }, { group = lint_augroup, callback = function() lint.try_lint(nil, { ignore_errors = true }) end, }) vim.api.nvim_create_autocmd({ "InsertLeave" }, { group = lint_augroup, callback = function() if vim.bo.filetype ~= "rust" then lint.try_lint(nil, { ignore_errors = true }) end end, }) end, }, }