-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Print trailing comma for type parameters #10109
Print trailing comma for type parameters #10109
Conversation
TS 2.7 was released 3 years ago. I don't think we need a major version for this. |
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.
This logic relies on the file extension (isTSXFile
), so I can't reproduce this on the playground:
test-tsx.tsx
:
const f = <Tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt, >() => 1
$ prettier test-tsx.tsx --trailing-comma all
const f = <
Tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt,,
>() => 1;
See also #3662 (comment)
BTW, this also means that Prettier has been outputting code with trailing commas in type parameters for a while already, at least for TSX. so this change is definitely safe for a non-major version.
f465e6c
to
d046790
Compare
Description
Fixes #3662.
I think we can do this at next major.
Checklist
changelog_unreleased/*/XXXX.md
file followingchangelog_unreleased/TEMPLATE.md
.✨Try the playground for this PR✨