neovim/lua/plugins/linting.lua
Devin Haska a4a51853e1
feat: add proselint
This also removes vale from my config. I was annoyed at how much setup
vale needed before it could work, and find that proselint does what I
want without the extras of vale.
2024-06-07 15:30:20 -07:00

29 lines
667 B
Lua

return {
{
"mfussenegger/nvim-lint",
opts = {
events = { "BufWritePost", "BufReadPost", "InsertLeave" },
linters_by_ft = {
html = { "djlint" },
markdown = { "proselint" },
javascript = { "eslint" },
typescript = { "eslint" },
javascriptreact = { "eslint" },
typescriptreact = { "eslint" },
},
},
config = function(_, opts)
local lint = require("lint")
lint.linters_by_ft = opts.linters_by_ft
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
vim.api.nvim_create_autocmd(opts.events, {
group = lint_augroup,
callback = function()
lint.try_lint()
end,
})
end,
},
}