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