-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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 formatting on JsxElement/JsxExpression #9361
Conversation
Would this change My team has adopted the first via a lint rule because the spacing makes it easier to read (subjective opinion, I know). If the TS formatter starts enforcing the second, well, there goes that 😅 |
@jwbay So we need an additional formatting option. Thanks for the information 👍 |
Now we have the option! |
👍 greatly appreciated! 🏆 |
@@ -1267,6 +1267,7 @@ namespace ts { | |||
InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean; | |||
InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: boolean; | |||
InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: boolean; | |||
InsertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: boolean; |
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 needs to be optional, or it is a breaking change.
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.
Sorry but I'm not sure what you mean by 'optional', do you want me to make it insert?: boolean
form?
Thanks @saschanaz. one comment about the optionality of the new format option, and we are good to go. |
Does it also fix #6716 (comment)? |
@chicoxyzzy Yes it does. |
@saschanaz Can you update the PR today? As we are getting closer to snap 2.0, this needs to get in soon |
@zhengbli I can if I get the answer for #9361 (comment). Not sure what 'optional' means here as any other fields on |
they were not optional originally, and that was a mistake. they should all have been optional from the get go. |
I think making it optional will make me forget adding corresponding fields on fourslash and editorServices for new default option value. Well, that is another story anyway ;) |
thanks as always @saschanaz! |
Fixes #8817, fixes #6716
Input:
Current:
Fix:
With new
InsertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces
option: