-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
move "(" and ")" to next lines if callee is parenthesized cascade sequence #549
Comments
I wonder how much of this was prior to trailing comma support that made Flutter happy. |
over_react maintainer here! Wow, I hadn't checked in in awhile, but it looks like the trailing commas make a world of difference!!
The only thing we'd want improved would be to wrap the first closing paren on its own line so that the prop cascading and nesting are more visually distinguished:
That being said, this is a _fantastic_ improvement over the previous formatting; I'm very excited to share this news! |
I'm not sure if we could pull off your ideal formatting without making other code that doesn't use this idiom—a parenthesized expression followed by an argument list—for the same reason look worse. |
What about if it were only done for parenthesized cascade expressions? 😃 |
No, those are actually sadly common in practice. Despite the fact that the designers deliberately chose a cascade syntax that doesn't nest well, users nest it all the time. If we changed how those are formatted, it would impact tons of existing code. |
Mm, fair enough. Thanks for giving it some thought! I'll have to familiarize myself with the different ways cascading are used to see if I can't come up with something. |
@munificent Just saw the updated title. To be clear, ideally we'd like to move closing paren to the next line as well. |
I think we're happy with the way parenthesized cascades are currently formatted. |
"At this time, we do not recommend using dartfmt, as it greatly decreases the readability of components built using OverReact's fluent-style." [1]
Seems unfortunate.
[1] https://github.com/Workiva/over_react#component-formatting
The text was updated successfully, but these errors were encountered: