-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[TS] Separate type alias entries using commas instead of semicolons #6655
Comments
(I am pretty sure this is about object types, not type aliases.) As a data point, it looks like |
Can this be made a configuration option? If I'm not mistaken this would be analogous to the @typescript-eslint/member-delimiter-style rule available in typescript-eslint, which is more relevant than tslint now that the latter is deprecated. (I happen to support commas instead of semicolons as a default value, but given that the tool's opinion seems to keep going back and forth, I question whether that opinion should trump all other opinions on this particular topic.) From the object types section that was linked in a previous comment:
That, combined with the existing trailing commas option that covers the last part of that same sentence, seem to make it a good candidate for being configurable, IMO. As things currently stand, it's a bit ironic that the name of the existing option is "trailing commas", yet Prettier enforces semicolons. |
@c32hedge If you don't know https://prettier.io/docs/en/option-philosophy.html, please see. |
@sosukesuzuki Thanks, hadn't seen that page. Fair enough. The semicolons instead of commas seemed to be the main thing that jumped out as jarring when I just started trying Prettier, so this change would make me a lot happier if not 100% satisfied. My main point above was that since Prettier's decision on this topic has already gone back and forth at least once, I just want to be able to "lock in" on one style. |
Honestly, I would close this issue сс @thorn0 |
I'm back to TS again on a Project and I still believe it would be better to go with commas and limit the usage of semicolons to separate statements, if this is really controversial we could explore the possibility of going with this approach only for type aliases (using commas), and keep interfaces the way they are now (with semicolons). What do you think? |
@mgtitimoli This isn't going to change. See the reasoning here: #7719 (comment) and #7719 (comment). |
Hi there,
Time has passed and new conventions (luckily) have arisen, @calebmer opened an issue some time ago asking for this and @vjeux replied that it was done and then it was rolled back.
A couple of comments later @mafredi said semicolon was used in official docs, and here is when I jump to say this is no longer true.
As you can see in the new handbook, type aliases are written using commas (thankfully), so it could make sense to open this debate again to collect opinions.
I will use the same technique @azz used in this comment
Vote here!
👍 Use commas
👎 Continue using semicolons
The text was updated successfully, but these errors were encountered: