feat: move all linting to linting.lua

This commit is contained in:
Devin Haska 2024-04-26 23:15:31 -06:00
parent bca2c8ec94
commit d6cf3129ff

26
lua/plugins/linting.lua Normal file
View file

@ -0,0 +1,26 @@
return {
"mfussenegger/nvim-lint",
opts = {
events = { "BufWritePost", "BufReadPost", "InsertLeave" },
linters_by_ft = {
html = { "djlint" },
javascript = { "eslint_d" },
typescript = { "eslint_d" },
javascriptreact = { "eslint_d" },
typescriptreact = { "eslint_d" },
},
},
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,
}