Closed RoyRao2333 closed 1 year ago
This works as expected:
Hope this clears things up - welcome to Svelte!
@dummdidumm
Thanks for the explanations! Really helpful. :)
But as I described above, can I make the trailing >
of <button>
in a new line like this?
I think this can separate component's attributes from the children (or slot?) within it and it's easy to read.
For that, remove "svelteBracketNewLine": false,
from your config
@dummdidumm
It's working and thanks for the help! You truly saved my day!
Here's my
.prettierrc.json
:Before formatting:
After formatting:
You can notice that codes in
<script>
tag lost indents.<button>
's props is also formatted wrong.But if I remove
"svelteIndentScriptAndStyle": false
and format:Seems alright but I think the trailing
>
of<button>
is supposed to be in a new line...I'm new to Svelte and really love this framework. I came from React and I just copy & paste the
.prettierrc
from my previous React project and made some changes. Don't know if I set something wrong, any help would be appreciated!