update formmatters

This commit is contained in:
xfy
2025-04-03 14:24:15 +08:00
parent df426d2d9e
commit 8ad66945f5

View File

@ -16,6 +16,8 @@ return {
typescriptreact = { "prettier" },
svelte = { "prettier" },
css = { "prettier" },
less = { "prettier" },
scss = { "prettier" },
html = { "prettier" },
json = { "prettier" },
yaml = { "prettier" },
@ -53,18 +55,6 @@ return {
return { lsp_fallback = true }
end,
notify_on_error = true,
formatters = {
injected = {
options = {
ignore_errors = true,
lang_to_formatters = {
sql = { "sqlfluff" },
},
lang_to_ext = {
sql = "sql",
},
},
},
lang_to_ext = {
bash = "sh",
sql = "sql",
@ -76,25 +66,6 @@ return {
ruby = "rb",
teal = "tl",
},
sqlfluff = {
command = "sqlfluff",
args = {
"fix",
"--dialect",
"sqlite",
"--disable-progress-bar",
"-f",
"-n",
"-",
},
stdin = true,
},
rustfmt = {
options = {
-- The default edition of Rust to use when no Cargo.toml file is found
default_edition = "2021",
},
},
options = {
-- Use a specific prettier parser for a filetype
-- Otherwise, prettier will try to infer the parser from the file name
@ -121,6 +92,37 @@ return {
-- qmd = "markdown",
},
},
formatters = {
injected = {
options = {
ignore_errors = true,
lang_to_formatters = {
sql = { "sqlfluff" },
},
lang_to_ext = {
sql = "sql",
},
},
},
sqlfluff = {
command = "sqlfluff",
args = {
"fix",
"--dialect",
"sqlite",
"--disable-progress-bar",
"-f",
"-n",
"-",
},
stdin = true,
},
rustfmt = {
options = {
-- The default edition of Rust to use when no Cargo.toml file is found
default_edition = "2021",
},
},
-- # Example of using dprint only when a dprint.json file is present
-- dprint = {
-- condition = function(ctx)