mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-21 00:25:50 +02:00
59 lines
1.2 KiB
Lua
59 lines
1.2 KiB
Lua
---@diagnostic disable: inject-field
|
|
if lazyvim_docs then
|
|
-- Enable this option to avoid conflicts with Prettier.
|
|
vim.g.lazyvim_prettier_needs_config = true
|
|
end
|
|
|
|
-- https://biomejs.dev/internals/language-support/
|
|
local supported = {
|
|
"astro",
|
|
"css",
|
|
"graphql",
|
|
-- "html",
|
|
"javascript",
|
|
"javascriptreact",
|
|
"json",
|
|
"jsonc",
|
|
-- "markdown",
|
|
"svelte",
|
|
"typescript",
|
|
"typescriptreact",
|
|
"vue",
|
|
-- "yaml",
|
|
}
|
|
|
|
return {
|
|
{
|
|
"mason-org/mason.nvim",
|
|
opts = { ensure_installed = { "biome" } },
|
|
},
|
|
|
|
{
|
|
"stevearc/conform.nvim",
|
|
optional = true,
|
|
---@param opts ConformOpts
|
|
opts = function(_, opts)
|
|
opts.formatters_by_ft = opts.formatters_by_ft or {}
|
|
for _, ft in ipairs(supported) do
|
|
opts.formatters_by_ft[ft] = opts.formatters_by_ft[ft] or {}
|
|
table.insert(opts.formatters_by_ft[ft], "biome")
|
|
end
|
|
|
|
opts.formatters = opts.formatters or {}
|
|
opts.formatters.biome = {
|
|
require_cwd = true,
|
|
}
|
|
end,
|
|
},
|
|
|
|
-- none-ls support
|
|
{
|
|
"nvimtools/none-ls.nvim",
|
|
optional = true,
|
|
opts = function(_, opts)
|
|
local nls = require("null-ls")
|
|
opts.sources = opts.sources or {}
|
|
table.insert(opts.sources, nls.builtins.formatting.biome)
|
|
end,
|
|
},
|
|
}
|