V2 (#1)
Co-authored-by: Devin Haska <wonderfulfrog@users.noreply.github.com>
This commit is contained in:
parent
bf73ba6099
commit
20c15285e5
26 changed files with 564 additions and 430 deletions
26
lua/plugins/linting.lua
Normal file
26
lua/plugins/linting.lua
Normal 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,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue