diff --git a/lua/lazyvim/plugins/extras/linting/nvim-lint.lua b/lua/lazyvim/plugins/extras/linting/nvim-lint.lua index fd380c12..f893395c 100644 --- a/lua/lazyvim/plugins/extras/linting/nvim-lint.lua +++ b/lua/lazyvim/plugins/extras/linting/nvim-lint.lua @@ -8,11 +8,10 @@ return { linters_by_ft = { fish = { "fish" }, }, - -- Custom linters, or fully replace a builtin - linters = {}, -- LazyVim extension to easily override linter options + -- or add custom linters. ---@type table - linter_opts = { + linters = { -- -- Example of using selene only when a selene.toml file is present -- selene = { -- -- `condition` is another LazyVim extension that allows you to @@ -33,12 +32,9 @@ return { end local lint = require("lint") for name, linter in pairs(opts.linters) do - lint.linters[name] = linter + lint.linters[name] = vim.tbl_deep_extend("force", lint.linters[name] or {}, linter) end lint.linters_by_ft = vim.tbl_extend("force", lint.linters_by_ft, opts.linters_by_ft) - for l, o in pairs(opts.linter_opts or {}) do - lint.linters[l] = vim.tbl_deep_extend("force", lint.linters[l], o) - end M._did_setup = true end