diff --git a/lua/lazyvim/plugins/extras/linting/nvim-lint.lua b/lua/lazyvim/plugins/extras/linting/nvim-lint.lua index c6c9629a..46a00574 100644 --- a/lua/lazyvim/plugins/extras/linting/nvim-lint.lua +++ b/lua/lazyvim/plugins/extras/linting/nvim-lint.lua @@ -3,12 +3,25 @@ return { "mfussenegger/nvim-lint", event = "BufReadPost", opts = { + -- Event to trigger linters events = { "BufWritePost", "BufReadPost", "InsertLeave" }, linters_by_ft = { fish = { "fish" }, }, + -- Custom linters, or fully replace a builtin linters = {}, - linter_opts = {}, + -- LazyVim extension to easily override linter options + ---@type table + linter_opts = { + -- -- Example of using selene only when a selene.toml file is present + selene = { + -- `condition` is another LazyVim extension that allows you to + -- dynamically enable/disable linters based on the context. + condition = function(ctx) + return vim.fs.find({ "selene.toml" }, { path = ctx.filename, upward = true })[1] + end, + }, + }, }, config = function(_, opts) local M = {}