-
-
Notifications
You must be signed in to change notification settings - Fork 499
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
fix(formatter): incompatibility for class and implements #4183
Conversation
Thank you for asking. I also thought it strange at first, so I checked how Prettier was working. Prettier would sometimes break a line even when it hadn't exceeded the line length. Do you think this issue is a Prettier error rather than something we need to change? |
CodSpeed Performance ReportMerging #4183 will degrade performances by 8.71%Comparing Summary
Benchmarks breakdown
|
I personally tend to think this is a bug in Prettier. |
I also feel like this is a bug in prettier, but I also think we should generally try to match prettier. The fix here doesn't seem that complicated. |
We could open an issue on the Prettier repository. |
I've opened prettier/prettier#16723 |
@@ -8,6 +8,14 @@ info: ts/class/implements_clause.ts | |||
class ClassName implements Interface { } | |||
|
|||
class LongClassName implements Interface1, Interface2, Interface3, Interface4, Interface5 { } | |||
|
|||
class LongClassName implements InterfaceNameLengthIsSixtySixCharacterssssssssssssssssssssssssssss { | |||
constructer(){} |
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.
NIT: typo
Closing, it's a prettier bug and they are fixing it |
fixes #4143
Summary
When checking the operation of Prettier, the fits function calculates the width of an empty string as 1 instead of 0. The empty string refers to line 15 in the code, and we are using it as a space.
So i changed space to hardspace
Test Plan
add test case