(nvim) setup biome formatting for html
This commit is contained in:
parent
51824ef86b
commit
f314f5e9ac
2 changed files with 21 additions and 0 deletions
13
biome/biome.json
Normal file
13
biome/biome.json
Normal 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -105,6 +105,7 @@ local formatters_by_ft = {
|
||||||
markdown = { "biome" },
|
markdown = { "biome" },
|
||||||
jsonc = { "biome" },
|
jsonc = { "biome" },
|
||||||
json = { "biome" },
|
json = { "biome" },
|
||||||
|
html = { "biome_html" },
|
||||||
go = { "gofmt", "goimports" },
|
go = { "gofmt", "goimports" },
|
||||||
python = { "autopep8" },
|
python = { "autopep8" },
|
||||||
yaml = { "yamlfmt" },
|
yaml = { "yamlfmt" },
|
||||||
|
|
@ -120,6 +121,13 @@ require("conform").setup({
|
||||||
notify_on_error = false,
|
notify_on_error = false,
|
||||||
formatters_by_ft = formatters_by_ft,
|
formatters_by_ft = formatters_by_ft,
|
||||||
formatters = {
|
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 = {
|
pint = {
|
||||||
command = "vendor/bin/pint",
|
command = "vendor/bin/pint",
|
||||||
args = { "$FILENAME" },
|
args = { "$FILENAME" },
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue