Repository navigation
Allow single-line array and object declarations, and multi-line function declarations - #5830
Conversation
|
Good stuff! Optional commas in arrays are great.
|
Yes it would work in decorators too |
|
So I think the options here are:
I'm leaning most heavily towards option 4 - it's purely additive, doesn't introduce 2 different ways of multiline arrays/objects, but still gives us the option to introduce this in future if we want to. |
We had a discussion on this today, and reached consensus on option 4, with code fixes to switch between single- and multi-line declarations. It leaves the door open to doing option 2 in the future if we get community feedback for it; whereas option 2 would be an irreversible decision. The remaining open question was regarding the formatter. I've proposed just fixing indention and spacing without deciding whether a declaration should or shouldn't be multi-line. We had agreement on wanting to pick a sensible opinionated default, and wanted to discuss whether we should pick a more opinionated Prettier-like approach. Personally I feel like we're unblocked on this PR (with a basic formatter implementation), and can try to get feedback on a community call in the future on a more sophisticated auto-formatter. |
a026cd3 to
753b0fa
Compare
753b0fa to
a7df5c2
Compare
7f69c79 to
8f02658
Compare
Shenglong Li (shenglol)
left a comment
There was a problem hiding this comment.
Looks good! Just a minor suggestion.
|
Thank you for these improvements ✅ A few things, with some comments.
Before
then format
looks like convert to single line also puts different it appears to build just fine error messages |










See discussion in #146
Closes #4993
Closes #498
Closes #586
This PR changes the following:
See Installing Nightly if you're interested in trying this out.
Here's a demo of this during the last community call: https://youtu.be/R6SyuRhTmmc?t=1145s