pageClass | sidebarDepth | title | description | since |
---|---|---|---|---|
rule-details |
0 |
svelte/html-closing-bracket-new-line |
Require or disallow a line break before tag's closing brackets |
v2.45.0 |
Require or disallow a line break before tag's closing brackets
- 🔧 The
--fix
option on the command line can automatically fix some of the problems reported by this rule.
This rule enforces a line break (or no line break) before tag's closing brackets, which can also be configured to be enforced on self-closing tags.
<script>
/* eslint svelte/brackets-same-line: "error" */
</script>
<!-- ✓ GOOD -->
<div></div>
<div
multiline
>
Children
</div>
<SelfClosing />
<SelfClosing
multiline
/>
<!-- ✗ BAD -->
<div
></div>
<div
multiline>
Children
</div>
<SelfClosing
/>
<SelfClosing
multiline/>
singleline
: ("never"
by default) Configuration for single-line elements. It's a single-line element if the element does not have attributes or the last attribute is on the same line as the opening bracket.multiline
: ("always"
by default) Configuration for multi-line elements. It's a multi-line element if the last attribute is not on the same line of the opening bracket.selfClosingTag.singleline
: Configuration for single-line self closing elements.selfClosingTag.multiline
: Configuration for multi-line self closing elements.
The selfClosing
is optional, and by default it will use the same configuration as singleline
and multiline
, respectively.
This rule was introduced in eslint-plugin-svelte v2.45.0