mirror of
https://github.com/kristoferssolo/SoloVim.git
synced 2026-02-04 06:42:05 +00:00
Update 2025-02-28
Update 2025-02-14 Update 2025-02-16 Update 2025-02-21 Update 2025-02-23 Update 2025-02-25 Update 2025-02-27 Update 2025-02-28
This commit is contained in:
28
lua/plugins/lint.lua
Normal file
28
lua/plugins/lint.lua
Normal file
@@ -0,0 +1,28 @@
|
||||
local js = { "biomejs" }
|
||||
return {
|
||||
"mfussenegger/nvim-lint",
|
||||
opts = {
|
||||
events = { "InsertLeave", "BufWritePost", "BufReadPost", "InsertEnter" },
|
||||
linters_by_ft = {
|
||||
javascript = js,
|
||||
javascriptreact = js,
|
||||
typescript = js,
|
||||
typescriptreact = js,
|
||||
python = { "mypy" },
|
||||
htmldjango = { "djlint" },
|
||||
lua = { "selene" },
|
||||
cmake = { "cmakelint" },
|
||||
["*"] = { "codespell", "typos" },
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
local lint = require("lint")
|
||||
lint.linters_by_ft = opts.linters_by_ft
|
||||
vim.api.nvim_create_autocmd(opts.events, {
|
||||
group = vim.api.nvim_create_augroup("nvim-lint", { clear = true }),
|
||||
callback = function()
|
||||
lint.try_lint()
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
||||
Reference in New Issue
Block a user