mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-22 08:53:33 +02:00
fix(prettier): fixup
This commit is contained in:
parent
af80811be0
commit
ac9217b199
1 changed files with 5 additions and 12 deletions
|
@ -10,7 +10,6 @@ local M = {}
|
||||||
|
|
||||||
local supported = {
|
local supported = {
|
||||||
"css",
|
"css",
|
||||||
"fish",
|
|
||||||
"graphql",
|
"graphql",
|
||||||
"handlebars",
|
"handlebars",
|
||||||
"html",
|
"html",
|
||||||
|
@ -19,14 +18,9 @@ local supported = {
|
||||||
"json",
|
"json",
|
||||||
"jsonc",
|
"jsonc",
|
||||||
"less",
|
"less",
|
||||||
"lua",
|
|
||||||
"markdown",
|
"markdown",
|
||||||
"markdown.mdx",
|
"markdown.mdx",
|
||||||
"mysql",
|
|
||||||
"plsql",
|
|
||||||
"scss",
|
"scss",
|
||||||
"sh",
|
|
||||||
"sql",
|
|
||||||
"typescript",
|
"typescript",
|
||||||
"typescriptreact",
|
"typescriptreact",
|
||||||
"vue",
|
"vue",
|
||||||
|
@ -79,12 +73,11 @@ return {
|
||||||
opts.formatters_by_ft[ft] = { "prettier" }
|
opts.formatters_by_ft[ft] = { "prettier" }
|
||||||
end
|
end
|
||||||
|
|
||||||
opts.formatters = {
|
opts.formatters = opts.formatters or {}
|
||||||
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))
|
||||||
end,
|
end,
|
||||||
},
|
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue