-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
Add option support for trailing comma in enums #354
Add option support for trailing comma in enums #354
Conversation
I'm not convinced that this is a feature we should support. |
I agree with you that options should be added very carefully, and this one could create a precedent. However, it is one of the very few options provided by Prettier, so we might consider it anyway |
Ah, sorry! I was not aware that prettier already provided this option. |
I believe array initializers are the only other part of the language that support trailing commas, we may want this option to apply there too:
For example: |
13a55df
to
977d93f
Compare
Ok, so let's do this! I added the trailing comma support in arrays too. I followed Prettier behavior which adds a comma (when the option is enabled) in arrays/objects only if they break |
977d93f
to
539882f
Compare
539882f
to
678a576
Compare
What changed with this PR:
Example
options:
Relative issues or prs:
Relative to #313, #314 and #319
cc @natdempk and @jhaber