(nvim) setup biome formatting for html

This commit is contained in:
juancwu 2026-05-31 20:05:09 +00:00
commit f314f5e9ac
2 changed files with 21 additions and 0 deletions

13
biome/biome.json Normal file
View file

@ -0,0 +1,13 @@
{
"$schema": "https://biomejs.dev/schemas/2.4.13/schema.json",
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 4
},
"html": {
"formatter": {
"enabled": true
}
}
}

View file

@ -105,6 +105,7 @@ local formatters_by_ft = {
markdown = { "biome" },
jsonc = { "biome" },
json = { "biome" },
html = { "biome_html" },
go = { "gofmt", "goimports" },
python = { "autopep8" },
yaml = { "yamlfmt" },
@ -120,6 +121,13 @@ require("conform").setup({
notify_on_error = false,
formatters_by_ft = formatters_by_ft,
formatters = {
-- biome's html formatter doesn't apply over stdin; use --write so it
-- edits the (temp) file in place, then conform reads it back
biome_html = {
command = "biome",
args = { "format", "--write", "$FILENAME" },
stdin = false,
},
pint = {
command = "vendor/bin/pint",
args = { "$FILENAME" },