Skip to content

Commit aa7b97e

Browse files
committed
feat: html documentation
1 parent dbf8b8f commit aa7b97e

File tree

1 file changed

+101
-0
lines changed

1 file changed

+101
-0
lines changed

src/content/docs/reference/configuration.mdx

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,6 +1152,107 @@ Enables Biome's assist for Grit files.
11521152
}
11531153
```
11541154

1155+
## `html`
1156+
1157+
:::caution
1158+
The HTML parser and formatter are still considered experimental, which means that breaking changes
1159+
can happen in patch and minor versions.
1160+
:::
1161+
1162+
### `html.parser.interpolation`
1163+
1164+
Enables the parsing of double text expressions such as `{{ expression }}` inside `.html` files.
1165+
1166+
> Default: `false`
1167+
1168+
### `html.formatter.enabled`
1169+
1170+
Enables Biome's formatter for HTML files.
1171+
1172+
> Default: `false`
1173+
1174+
### `html.formatter.enabled`
1175+
1176+
Whether this formatting option should be enabled.
1177+
1178+
> Default: `true`
1179+
1180+
### `html.formatter.indentStyle`
1181+
1182+
The style of the indentation for HTML files. It can be `"tab"` or `"space"`.
1183+
1184+
> Default: `"tab"`
1185+
1186+
### `html.formatter.indentWidth`
1187+
1188+
How big the indentation should be for HTML files.
1189+
1190+
> Default: `2`
1191+
1192+
### `html.formatter.lineEnding`
1193+
1194+
The type of line ending for HTML files.
1195+
- `"lf"`, Line Feed only (`\n`), common on Linux and macOS as well as inside git repos;
1196+
- `"crlf"`, Carriage Return + Line Feed characters (`\r\n`), common on Windows;
1197+
- `"cr"`, Carriage Return character only (`\r`), used very rarely.
1198+
1199+
> Default: `"lf"`
1200+
1201+
### `html.formatter.lineWidth`
1202+
1203+
The amount of characters that can be written on a single line in HTML files.
1204+
1205+
> Default: `80`
1206+
1207+
### `html.formatter.attributePosition`
1208+
1209+
The attribute position style in HTML elements.
1210+
- `"auto"`, the attributes are automatically formatted, and they will collapse in multiple lines only when they hit certain criteria;
1211+
- `"multiline"`, the attributes will collapse in multiple lines if more than 1 attribute is used.
1212+
1213+
> Default: `"auto"`
1214+
1215+
### `html.formatter.bracketSameLine`
1216+
1217+
Whether to hug the closing bracket of multiline HTML tags to the end of the last line, rather than being alone on the following line.
1218+
1219+
> Default: `false`
1220+
1221+
### `html.formatter.whitespacesSensitivity`
1222+
1223+
Whether to account for whitespace sensitivity when formatting HTML (and its super languages).
1224+
1225+
> Default: "css"
1226+
1227+
1228+
- `"css"`: The formatter considers whitespace significant for elements that have an "inline" display style by default in browser's user agent style sheets.
1229+
- `"strict"`: Leading and trailing whitespace in content is considered significant for all elements.
1230+
1231+
The formatter should leave at least one whitespace character if whitespace is present.
1232+
Otherwise, if there is no whitespace, it should not add any after `>` or before `<`. In other words, if there's no whitespace, the text content should hug the tags.
1233+
1234+
Example of text hugging the tags:
1235+
```html
1236+
<b
1237+
>content</b
1238+
>
1239+
```
1240+
- `"ignore"`: whitespace is considered insignificant. The formatter is free to remove or add whitespace as it sees fit.
1241+
1242+
### `html.formatter.indentScriptAndStyle`
1243+
1244+
Whether to indent the `<script>` and `<style>` tags for HTML (and its super languages).
1245+
1246+
> Default: `true`
1247+
1248+
### `html.formatter.selfCloseVoidElements`
1249+
1250+
Whether void elements should be self-closed. Defaults to never.
1251+
1252+
> Default: `"never"`
1253+
1254+
- `"never"`: The slash `/` inside void elements is removed by the formatter.
1255+
- `"always"`: The slash `/` inside void elements is always added.
11551256

11561257
## `overrides`
11571258

0 commit comments

Comments
 (0)