Files
dotfiles/common/.config/nvim/lua/plugins/linting.lua
Pratik Tripathy 79d80bd7de fix(neovim): LSP, Formatter, Linter all in their places
- Formatter: Don't need both prettier & prettierd. Only use prettierd
- Formatter: markdown-toc is LSP not formatter
- Formatter: shellharden isn't formatter
- Formatter: Only shfmt for shell formatting
- Formatter: Don't need prettier to format yaml
- Linter: codespell on all buffers
- Install script: Remove prettier & shellharden (its useless with bashls)
- LSP: markdownlint, prettier, shellcheck, shellharden, shfmt aren't LSP
2025-09-10 23:58:43 +05:30

37 lines
1.1 KiB
Lua

return {
{
"mfussenegger/nvim-lint",
lazy = true,
event = { "BufReadPre", "BufNewFile" },
config = function()
local lint = require("lint")
-- Linters are only required for dynamically typed languages
lint.linters_by_ft = {
python = { "pylint" },
markdown = { "markdownlint" },
yaml = { "yamllint" },
dockerfile = { "hadolint" },
["*"] = { "codespell" },
}
local markdownlint = lint.linters.markdownlint
markdownlint.args = {
"--config",
vim.loop.os_homedir() .. "/.config/templates/markdownlint.json",
"--",
}
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
group = lint_augroup,
callback = function()
lint.try_lint()
end,
})
end,
},
}