V2 #1
1 changed files with 9 additions and 15 deletions
|
@ -1,28 +1,22 @@
|
|||
return {
|
||||
"mfussenegger/nvim-lint",
|
||||
event = {
|
||||
"BufReadPre",
|
||||
"BufNewFile",
|
||||
},
|
||||
config = function()
|
||||
local lint = require("lint")
|
||||
|
||||
local djlint = lint.linters.djlint
|
||||
djlint.args = {
|
||||
"--reformat",
|
||||
}
|
||||
|
||||
lint.linters_by_ft = {
|
||||
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({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
||||
vim.api.nvim_create_autocmd(opts.events, {
|
||||
group = lint_augroup,
|
||||
callback = function()
|
||||
lint.try_lint()
|
Loading…
Add table
Add a link
Reference in a new issue