fix(biome): use biome-check in conform that also fixes linting issues and sorts imports

This commit is contained in:
Folke Lemaitre 2026-03-16 18:11:45 +01:00
parent 31caef21fd
commit 954d8746e5
No known key found for this signature in database
GPG key ID: 9B52594D560070AB

View file

@ -1,3 +1,5 @@
---@module "conform"
---@diagnostic disable: inject-field ---@diagnostic disable: inject-field
if lazyvim_docs then if lazyvim_docs then
-- Enable this option to avoid conflicts with Prettier. -- Enable this option to avoid conflicts with Prettier.
@ -31,16 +33,16 @@ return {
{ {
"stevearc/conform.nvim", "stevearc/conform.nvim",
optional = true, optional = true,
---@param opts ConformOpts ---@param opts conform.setupOpts
opts = function(_, opts) opts = function(_, opts)
opts.formatters_by_ft = opts.formatters_by_ft or {} opts.formatters_by_ft = opts.formatters_by_ft or {}
for _, ft in ipairs(supported) do for _, ft in ipairs(supported) do
opts.formatters_by_ft[ft] = opts.formatters_by_ft[ft] or {} opts.formatters_by_ft[ft] = opts.formatters_by_ft[ft] or {}
table.insert(opts.formatters_by_ft[ft], "biome") table.insert(opts.formatters_by_ft[ft], "biome-check")
end end
opts.formatters = opts.formatters or {} opts.formatters = opts.formatters or {}
opts.formatters.biome = { opts.formatters["biome-check"] = {
require_cwd = true, require_cwd = true,
} }
end, end,