yew-fmt icon indicating copy to clipboard operation
yew-fmt copied to clipboard

[Discussion] How many braced variables should be put on one line?

Open aDogCalledSpot opened this issue 1 year ago • 2 comments

It makes sense to say that

html! {
    <Component>{ foo }</Component>

is formatted correctly.

However something like

html! {
    <Component>
         { foo }
         { bar }
         { baz }
         { foobar }
   </Component>
}

should maybe be kept that way even though it could possibly be merged onto one line.

I think there might be semantic meaning to the variables that would make you prefer splitting the lines (e.g. components into new lines, strings onto same line).

Would always splitting lines at two variables make sense?

aDogCalledSpot avatar Feb 12 '24 08:02 aDogCalledSpot