nvim: Replace null-ls with nvim-lint
Fully replaced null-ls. Will need more tweaking on the nvim-lint setup but works generally for now. Works well in tandem with conform formatter.
This commit is contained in:
parent
5ccf8bc1fc
commit
ab06ef922b
3 changed files with 55 additions and 62 deletions
|
|
@ -55,14 +55,6 @@ return {
|
|||
"williamboman/mason-lspconfig.nvim",
|
||||
cmd = { "LspInstall", "LspUninstall" },
|
||||
},
|
||||
{
|
||||
"jose-elias-alvarez/null-ls.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"jay-babu/mason-null-ls.nvim",
|
||||
},
|
||||
event = "VeryLazy",
|
||||
},
|
||||
},
|
||||
event = "BufReadPost",
|
||||
config = function()
|
||||
|
|
@ -75,6 +67,50 @@ return {
|
|||
} },
|
||||
},
|
||||
|
||||
-- linting setup
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
config = function()
|
||||
local linters = {
|
||||
astro = {},
|
||||
bash = {},
|
||||
javascript = {},
|
||||
javascriptreact = {},
|
||||
markdown = {},
|
||||
quarto = {},
|
||||
sh = {},
|
||||
svelte = {},
|
||||
text = {},
|
||||
typescript = {},
|
||||
typescriptreact = {},
|
||||
}
|
||||
local per_cmd = function(cmd, ft_table)
|
||||
if vim.fn.executable(cmd) == 1 then
|
||||
for _, v in pairs(ft_table) do
|
||||
table.insert(v, cmd)
|
||||
end
|
||||
end
|
||||
end
|
||||
per_cmd("markdownlint", { linters.markdown })
|
||||
per_cmd("vale", { linters.markdown, linters.text, linters.quarto })
|
||||
per_cmd("shellcheck", { linters.sh, linters.bash })
|
||||
per_cmd("eslint_d", {
|
||||
linters.astro,
|
||||
linters.javascript,
|
||||
linters.javascriptreact,
|
||||
linters.svelte,
|
||||
linters.typescript,
|
||||
linters.typescriptreact,
|
||||
})
|
||||
require("lint").linters_by_ft = linters
|
||||
vim.api.nvim_create_autocmd({ "BufWritePost", "InsertLeave" }, {
|
||||
callback = function()
|
||||
require("lint").try_lint()
|
||||
end,
|
||||
})
|
||||
end,
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
},
|
||||
|
||||
-- formatting setup
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue