fix(markdown): enable config file discovery for markdownlint-cli2

This commit is contained in:
Carles Andres 2026-03-02 13:40:28 +00:00
parent 31caef21fd
commit ab5df18af7
No known key found for this signature in database
GPG key ID: ED23334AEAEC4286

View file

@ -56,11 +56,23 @@ return {
{ {
"mfussenegger/nvim-lint", "mfussenegger/nvim-lint",
optional = true, optional = true,
opts = { opts = function(_, opts)
linters_by_ft = { opts.linters_by_ft = opts.linters_by_ft or {}
markdown = { "markdownlint-cli2" }, opts.linters_by_ft.markdown = { "markdownlint-cli2" }
},
}, opts.linters = opts.linters or {}
opts.linters["markdownlint-cli2"] = {
-- Disable stdin to enable config file discovery.
-- markdownlint-cli2 traverses directories to find .markdownlint.json,
-- .markdownlint-cli2.jsonc, etc., but this only works with file paths.
stdin = false,
args = {},
parser = require("lint.parser").from_errorformat("%f:%l:%c %m,%f:%l %m", {
source = "markdownlint",
severity = vim.diagnostic.severity.WARN,
}),
}
end,
}, },
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",