-
Notifications
You must be signed in to change notification settings - Fork 753
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
Allow single-line array and object declarations, and multi-line function declarations #5830
Conversation
Good stuff! Optional commas in arrays are great. please 🥇 |
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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