From f314f5e9acf09e20e70359422dc898a1b89cc8b5 Mon Sep 17 00:00:00 2001 From: juancwu Date: Sun, 31 May 2026 20:05:09 +0000 Subject: [PATCH] (nvim) setup biome formatting for html --- biome/biome.json | 13 +++++++++++++ nvim/lua/plugins.lua | 8 ++++++++ 2 files changed, 21 insertions(+) create mode 100644 biome/biome.json diff --git a/biome/biome.json b/biome/biome.json new file mode 100644 index 0000000..855a380 --- /dev/null +++ b/biome/biome.json @@ -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 + } + } +} diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua index 475716e..435b2bc 100644 --- a/nvim/lua/plugins.lua +++ b/nvim/lua/plugins.lua @@ -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" },