fix(nvim-lint): use linters
for both custom and overriding linters
This commit is contained in:
@ -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<string,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
|
||||
|
||||
|
Reference in New Issue
Block a user