Skip to content

Commit

Permalink
(docs) better explanation of svelteBracketNewLine
Browse files Browse the repository at this point in the history
  • Loading branch information
dummdidumm authored Jan 13, 2021
1 parent f189195 commit 342182f
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,37 @@ Example:

### Svelte Bracket New Line

Put the `>` of a multiline element on a new line, if possible. Roughly the Svelte equivalent of the [jsxBracketSameLine](https://prettier.io/docs/en/options.html#jsx-brackets) rule.
Put the `>` of a multiline element on a new line. Roughly the Svelte equivalent of the [jsxBracketSameLine](https://prettier.io/docs/en/options.html#jsx-brackets) rule. Setting this to `false` will have no effect for whitespace-sensitive tags (inline elements) when there's no whitespace between the `>` of the start tag and the inner content, or when there's no whitespace after the `>` of the end tag.

Example:

```html
<!-- before formatting -->
<span><div>foo</div><span>bar</span></span>
<div pretend break>content</div>

<!-- after formatting, svelteBracketNewLine true -->
<span
><div>asd</div>
<span>asd</span></span
>
<div
pretend
break
>
content
</div>

<!-- after formatting, svelteBracketNewLine false -->
<span
><div>asd</div>
<span>asd</span></span>
<div
pretend
break>
content
</div>
```

| Default | CLI Override | API Override |
| ------- | ---------------------------------- | ------------------------------ |
Expand Down

0 comments on commit 342182f

Please sign in to comment.