svelteBracketNewLine: false not working
See original GitHub issueAfter the update to v2, I added svelteBracketNewLine: false
to my Prettier config as I prefer the previous formatting. This setting seems to be ignored though. Prettier now closes multiline tags on a new line regardless. Here’s my full config:
# .prettierrc.yml
semi: false
singleQuote: true
svelteBracketNewLine: false
overrides:
- files: '*.svelte'
options:
printWidth: 90
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Prettier plugin does not format *.svelte files, even ... - YouTrack
If I make a change to the file such as adding "semi": false to remove semicolons, ... "Run for files" is not working...
Read more >prettier-plugin-svelte - npm
Start using prettier-plugin-svelte in your project by running `npm i ... after formatting, svelteBracketNewLine false --> <span > ...
Read more >Errors with Svelte, TypeScript, ESLint, & Prettier Together
To clarify, ESLint works fine on its own. Prettier works fine on its own. However, when I combine them is when the problem...
Read more >Format Your Svelte Components using Prettier - Morioh
Setting this to false will have no effect for whitespace-sensitive tags (inline elements) when there's no whitespace between the > of the start...
Read more >@dylanvann/prettier-plugin-svelte - npm package | Snyk
Option to enable/disable component attribute shorthand if attribute name and expression are same. svelteBracketNewLine. Default: false; Put the ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
After I slept over it, I think you are right that closing tags should also be printed in the same line if possible. Possible means: There’s whitespace after the
>
, or it’s the last child inside a block element where whitespace doesn’t matter at the outer edges. This will be fixed with2.0.3
.Thanks for the clarification. So this closing bracket on new line behavior is non-configurable?
I think it adds unnecessary vertical space and also confuses VS Code syntax highlighting as you can see in the screenshot.