✨ feat(nvim): add extra lua linter: selene
This commit is contained in:
parent
2cb33758da
commit
946699f332
1 changed files with 26 additions and 0 deletions
26
.config/nvim/lua/plugins/extras/linting/selene.lua
Normal file
26
.config/nvim/lua/plugins/extras/linting/selene.lua
Normal file
|
@ -0,0 +1,26 @@
|
|||
return {
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "selene" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
opts = function(_, opts)
|
||||
opts.linters_by_ft.lua = opts.linters_by_ft.lua or {}
|
||||
table.insert(opts.linters_by_ft.lua, "selene")
|
||||
|
||||
opts.linters = {
|
||||
selene = {
|
||||
condition = function(ctx)
|
||||
return vim.fs.find({ "selene.toml" }, { path = ctx.filename, upward = true })[1]
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
return opts
|
||||
end,
|
||||
},
|
||||
}
|
Loading…
Add table
Reference in a new issue