feat: add djlint to html files
This commit is contained in:
parent
f7100e7871
commit
752e013e66
1 changed files with 22 additions and 21 deletions
|
@ -1,26 +1,27 @@
|
||||||
return {
|
return {
|
||||||
"mfussenegger/nvim-lint",
|
"mfussenegger/nvim-lint",
|
||||||
event = {
|
event = {
|
||||||
"BufReadPre",
|
"BufReadPre",
|
||||||
"BufNewFile",
|
"BufNewFile",
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local lint = require("lint")
|
local lint = require("lint")
|
||||||
|
|
||||||
lint.linters_by_ft = {
|
lint.linters_by_ft = {
|
||||||
javascript = { "eslint_d" },
|
html = { "djlint" },
|
||||||
typescript = { "eslint_d" },
|
javascript = { "eslint_d" },
|
||||||
javascriptreact = { "eslint_d" },
|
typescript = { "eslint_d" },
|
||||||
typescriptreact = { "eslint_d" },
|
javascriptreact = { "eslint_d" },
|
||||||
}
|
typescriptreact = { "eslint_d" },
|
||||||
|
}
|
||||||
|
|
||||||
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
|
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
||||||
group = lint_augroup,
|
group = lint_augroup,
|
||||||
callback = function()
|
callback = function()
|
||||||
lint.try_lint()
|
lint.try_lint()
|
||||||
end
|
end,
|
||||||
})
|
})
|
||||||
end
|
end,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue