init
This commit is contained in:
66
nvim/lua/plugins/extras/linting/biome.lua
Normal file
66
nvim/lua/plugins/extras/linting/biome.lua
Normal file
@@ -0,0 +1,66 @@
|
||||
return {
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"biome",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
biome = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
opts = function(_, opts)
|
||||
local function add_formatters(tbl)
|
||||
for ft, formatters in pairs(tbl) do
|
||||
if opts.formatters_by_ft[ft] == nil then
|
||||
opts.formatters_by_ft[ft] = formatters
|
||||
else
|
||||
vim.list_extend(opts.formatters_by_ft[ft], formatters)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
add_formatters({
|
||||
["jsonc"] = { "biome" },
|
||||
["json"] = { "biome" },
|
||||
["javascript"] = { "biome" },
|
||||
["typescript"] = { "biome" },
|
||||
["typescriptreact"] = { "biome" },
|
||||
["javascriptreact"] = { "biome" },
|
||||
["astro"] = { "biome" },
|
||||
["svelte"] = { "biome" },
|
||||
["vue"] = { "biome" },
|
||||
["graphql"] = { "biome" },
|
||||
["css"] = { "biome" },
|
||||
})
|
||||
|
||||
opts.formatters = {
|
||||
biome = {
|
||||
condition = function(self, ctx)
|
||||
return vim.fs.find({ "biome.json" }, { path = ctx.filename, upward = true })[1]
|
||||
end,
|
||||
},
|
||||
prettier = {
|
||||
condition = function(self, ctx)
|
||||
return not vim.fs.find({ "biome.json" }, { path = ctx.filename, upward = true })[1]
|
||||
end,
|
||||
},
|
||||
prettierd = {
|
||||
condition = function(self, ctx)
|
||||
return not vim.fs.find({ "biome.json" }, { path = ctx.filename, upward = true })[1]
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
return opts
|
||||
end,
|
||||
},
|
||||
}
|
||||
12
nvim/lua/plugins/extras/linting/eslint-extended.lua
Normal file
12
nvim/lua/plugins/extras/linting/eslint-extended.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
return {
|
||||
{ import = "lazyvim.plugins.extras.linting.eslint" },
|
||||
{
|
||||
"luckasRanarison/nvim-devdocs",
|
||||
optional = true,
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"eslint",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
18
nvim/lua/plugins/extras/linting/pylint.lua
Normal file
18
nvim/lua/plugins/extras/linting/pylint.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
return {
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"pylint",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
opts = function(_, opts)
|
||||
opts.linters_by_ft.python = opts.linters_by_ft.python or {}
|
||||
table.insert(opts.linters_by_ft.python, "pylint")
|
||||
return opts
|
||||
end,
|
||||
},
|
||||
}
|
||||
27
nvim/lua/plugins/extras/linting/selene.lua
Normal file
27
nvim/lua/plugins/extras/linting/selene.lua
Normal file
@@ -0,0 +1,27 @@
|
||||
return {
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"selene",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"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,
|
||||
},
|
||||
}
|
||||
18
nvim/lua/plugins/extras/linting/typos.lua
Normal file
18
nvim/lua/plugins/extras/linting/typos.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
return {
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"typos",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
opts = function(_, opts)
|
||||
opts.linters_by_ft["*"] = opts.linters_by_ft["*"] or {}
|
||||
table.insert(opts.linters_by_ft["*"], "typos")
|
||||
return opts
|
||||
end,
|
||||
},
|
||||
}
|
||||
18
nvim/lua/plugins/extras/linting/vale.lua
Normal file
18
nvim/lua/plugins/extras/linting/vale.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
return {
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"vale",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
opts = function(_, opts)
|
||||
opts.linters_by_ft.markdown = opts.linters_by_ft.markdown or {}
|
||||
table.insert(opts.linters_by_ft.markdown, "vale")
|
||||
return opts
|
||||
end,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user