feat(extras): switch to markdownlint-cli2 (#3843)

## What is this PR for?
This PR switches makrdownlint-cli to markdownlint-cli2.
markdownlint-cli2 should be a bit faster than markdownlint-cli and has a
more flexible configuration through files in the whole directory tree.
The cli is maintained by David Anson who also wrote the markdown style
checker itself which is used by the "old" cli and cli2.

Blog post from David Anson regarding the new cli itself:
https://dlaa.me/blog/post/markdownlintcli2

## Does this PR fix an existing issue?
 No

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
This commit is contained in:
Maximilian Stinsky 2024-06-29 10:41:20 +02:00 committed by GitHub
parent d6429a5c8a
commit f47d105b80
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -15,14 +15,14 @@ return {
optional = true, optional = true,
opts = { opts = {
formatters_by_ft = { formatters_by_ft = {
["markdown"] = { { "prettierd", "prettier" }, "markdownlint", "markdown-toc" }, ["markdown"] = { { "prettierd", "prettier" }, "markdownlint-cli2", "markdown-toc" },
["markdown.mdx"] = { { "prettierd", "prettier" }, "markdownlint", "markdown-toc" }, ["markdown.mdx"] = { { "prettierd", "prettier" }, "markdownlint-cli2", "markdown-toc" },
}, },
}, },
}, },
{ {
"williamboman/mason.nvim", "williamboman/mason.nvim",
opts = { ensure_installed = { "markdownlint", "markdown-toc" } }, opts = { ensure_installed = { "markdownlint-cli2", "markdown-toc" } },
}, },
{ {
"nvimtools/none-ls.nvim", "nvimtools/none-ls.nvim",
@ -30,7 +30,7 @@ return {
opts = function(_, opts) opts = function(_, opts)
local nls = require("null-ls") local nls = require("null-ls")
opts.sources = vim.list_extend(opts.sources or {}, { opts.sources = vim.list_extend(opts.sources or {}, {
nls.builtins.diagnostics.markdownlint, nls.builtins.diagnostics.markdownlint_cli2,
}) })
end, end,
}, },
@ -39,7 +39,7 @@ return {
optional = true, optional = true,
opts = { opts = {
linters_by_ft = { linters_by_ft = {
markdown = { "markdownlint" }, markdown = { "markdownlint-cli2" },
}, },
}, },
}, },