feat: moved linting and formatting to plugins

This commit is contained in:
Devin Lumley 2024-01-09 17:06:19 -08:00
parent 9f98fb46ce
commit 0dcc4fa0ed
3 changed files with 70 additions and 12 deletions

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

@ -0,0 +1,26 @@
return {
"mfussenegger/nvim-lint",
event = {
"BufReadPre",
"BufNewFile",
},
config = function ()
local lint = require("lint")
lint.linters_by_ft = {
javascript = { "eslint_d" },
typescript = { "eslint_d" },
javascriptreact = { "eslint_d" },
typescriptreact = { "eslint_d" },
}
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
}