fix: moved to prittier d

This commit is contained in:
Kemboi Elvis 2025-06-04 12:26:43 +03:00
parent 4ccb323363
commit d1f2664dbf

View file

@ -59,7 +59,7 @@ M.has_parser = LazyVim.memoize(M.has_parser)
return {
{
"mason-org/mason.nvim",
opts = { ensure_installed = { "prettier" } },
opts = { ensure_installed = { "prettierd", "prettier" } },
},
-- conform
@ -70,11 +70,17 @@ return {
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], "prettier")
opts.formatters_by_ft[ft] = { "prettierd", "prettier" }
end
opts.formatters = opts.formatters or {}
opts.formatters.prettierd = {
condition = function(_, ctx)
return M.has_parser(ctx) and (vim.g.lazyvim_prettier_needs_config ~= true or M.has_config(ctx))
end,
}
opts.formatters.prettier = {
condition = function(_, ctx)
return M.has_parser(ctx) and (vim.g.lazyvim_prettier_needs_config ~= true or M.has_config(ctx))
@ -90,7 +96,7 @@ return {
opts = function(_, opts)
local nls = require("null-ls")
opts.sources = opts.sources or {}
table.insert(opts.sources, nls.builtins.formatting.prettier)
table.insert(opts.sources, nls.builtins.formatting.prettierd)
end,
},
}