-
Notifications
You must be signed in to change notification settings - Fork 243
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 trailing comma in tuples #789
Comments
+1 we should allow it. I am less opinionated on what the formatter should do, but I think following the prettier defaults makes sense. |
I'm thinking we should maybe consider allowing trailing in all lists and leave it to the formatter if we have opinions about when not to use it (like in a single line). When I refactored everything to go through parseList helper, I preserved the cases where trailing delimiter is not allowed, but there's an explicit |
I made examples of all the places: Model properties and interface members are also OK today, but not shown. |
Proposal
Implementation issue notes:
|
Approved on 8/3 design meeting. #809 tracks implementation. |
We had a bug in the formatter that was adding a trailing comma to multi line tuple but this isn't something we actually support.
From bug #787, bug fix the formatter to remove the trailing comma but question is should we allow the other way around and have the formatter add it automatically.
TS/JS support that and prettier (at least our config) will automatically add one. This make it nicer to work with multi line arrays, reducing the number of line changed in diff when adding a new entry at the end and make it easier to move items around.
The text was updated successfully, but these errors were encountered: