feat: move all linting to linting.lua
This commit is contained in:
parent
bca2c8ec94
commit
d6cf3129ff
1 changed files with 9 additions and 15 deletions
|
@ -1,28 +1,22 @@
|
||||||
return {
|
return {
|
||||||
"mfussenegger/nvim-lint",
|
"mfussenegger/nvim-lint",
|
||||||
event = {
|
opts = {
|
||||||
"BufReadPre",
|
events = { "BufWritePost", "BufReadPost", "InsertLeave" },
|
||||||
"BufNewFile",
|
linters_by_ft = {
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
local lint = require("lint")
|
|
||||||
|
|
||||||
local djlint = lint.linters.djlint
|
|
||||||
djlint.args = {
|
|
||||||
"--reformat",
|
|
||||||
}
|
|
||||||
|
|
||||||
lint.linters_by_ft = {
|
|
||||||
html = { "djlint" },
|
html = { "djlint" },
|
||||||
javascript = { "eslint_d" },
|
javascript = { "eslint_d" },
|
||||||
typescript = { "eslint_d" },
|
typescript = { "eslint_d" },
|
||||||
javascriptreact = { "eslint_d" },
|
javascriptreact = { "eslint_d" },
|
||||||
typescriptreact = { "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 })
|
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,
|
group = lint_augroup,
|
||||||
callback = function()
|
callback = function()
|
||||||
lint.try_lint()
|
lint.try_lint()
|
Loading…
Add table
Add a link
Reference in a new issue