This commit is contained in:
Ivan Isakov 2026-06-04 16:38:15 +09:00 committed by GitHub
commit 32676fe715
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -32,13 +32,19 @@ return {
config = function(_, opts)
local M = {}
local function list_prepend(dst, src)
for i = 1, #src do
table.insert(dst, i, src[i])
end
end
local lint = require("lint")
for name, linter in pairs(opts.linters) do
if type(linter) == "table" and type(lint.linters[name]) == "table" then
lint.linters[name] = vim.tbl_deep_extend("force", lint.linters[name], linter)
if type(linter.prepend_args) == "table" then
lint.linters[name].args = lint.linters[name].args or {}
vim.list_extend(lint.linters[name].args, linter.prepend_args)
list_prepend(lint.linters[name].args, linter.prepend_args)
end
else
lint.linters[name] = linter