Skip to content

Commit b235a08

Browse files
authored
docs(html-self-closing): new confiuration
1 parent 843548e commit b235a08

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

docs/rules/html-self-closing.md

+13-6
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ You can choose either two styles for elements without content
5454
{
5555
"svelte/html-self-closing": [
5656
"error",
57-
{
57+
"all", // or "html" or "none" (preset)
58+
{ // overrides
5859
"void": "always", // or "always" or "ignore"
5960
"normal": "always", // or "never" or "ignore"
6061
"component": "always", // or "never" or "ignore"
@@ -64,12 +65,18 @@ You can choose either two styles for elements without content
6465
}
6566
```
6667

67-
- `void` (`"always"` by default)... Style of HTML void elements
68-
- `component` (`"always"` by default)... Style of svelte components
69-
- `svelte` (`"always"` by default)... Style of svelte special elements (`<svelte:head>`, `<svelte:self>`)
70-
- `normal` (`"always"` by default)... Style of other elements
68+
presets:
69+
- `all` - all elements should be self closing (unless they have children)
70+
- `html` - html-compliant - only void elements and svelte special elements should be self closing
71+
- `none` - no elements should be self closing
7172

72-
Every option can be set to
73+
overrides:
74+
- `void` (`"always"` in default preset)... Style of HTML void elements
75+
- `component` (`"always"` in default preset)... Style of svelte components
76+
- `svelte` (`"always"` in default preset)... Style of svelte special elements (`<svelte:head>`, `<svelte:self>`)
77+
- `normal` (`"always"` in default preset)... Style of other elements
78+
79+
Every override option can be set to
7380
- "always" (`<div />`)
7481
- "never" (`<div></div>`)
7582
- "ignore" (either `<div />` or `<div></div>`)

0 commit comments

Comments
 (0)