mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
fix: moved to prittier d
This commit is contained in:
parent
4ccb323363
commit
d1f2664dbf
1 changed files with 10 additions and 4 deletions
|
|
@ -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,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue