dotfiles/nvim/.config/nvim/lua/plugins/linting.lua
Marty Oehme b57f895093
nvim: Disable line length diagnostic for md files
By default disable the line length for any markdown file. I never use it
and I always turn it off. If I need it for a specific project I can
still figure out how to make the configuration override this.
2024-12-01 15:22:01 +01:00

40 lines
972 B
Lua

local linters = {
astro = { "eslint_d" },
bash = { "shellcheck" },
javascript = { "eslint_d" },
javascriptreact = { "eslint_d" },
go = { "revive" },
markdown = { "markdownlint" },
quarto = { "markdownlint" },
sh = { "shellcheck" },
svelte = { "eslint_d" },
text = {},
typescript = { "eslint_d" },
typescriptreact = { "eslint_d" },
}
return {
-- linting setup
{
"rshkarin/mason-nvim-lint",
dependencies = {
{
"mfussenegger/nvim-lint",
config = function()
require("lint").linters_by_ft = linters
require("lint").linters.markdownlint.args = { "--stdin", "--disable", "MD013", "--" }
vim.api.nvim_create_autocmd({ "BufWritePost", "InsertLeave" }, {
callback = function()
if not vim.g.disable_autolint then
require("lint").try_lint()
end
end,
})
end,
dependencies = { "williamboman/mason.nvim" },
},
},
event = { "BufReadPost", "BufNewFile", "BufWritePre" },
opts = {},
},
}