@@ -231,8 +231,8 @@ namespace ts.formatting {
231
231
rule ( "SpaceAfterConstructor" , SyntaxKind . ConstructorKeyword , SyntaxKind . OpenParenToken , [ isOptionEnabled ( "insertSpaceAfterConstructor" ) , isNonJsxSameLineTokenContext ] , RuleAction . Space ) ,
232
232
rule ( "NoSpaceAfterConstructor" , SyntaxKind . ConstructorKeyword , SyntaxKind . OpenParenToken , [ isOptionDisabledOrUndefined ( "insertSpaceAfterConstructor" ) , isNonJsxSameLineTokenContext ] , RuleAction . Delete ) ,
233
233
234
- rule ( "SpaceAfterComma" , SyntaxKind . CommaToken , anyToken , [ isOptionEnabled ( "insertSpaceAfterCommaDelimiter" ) , isNonJsxSameLineTokenContext , isNonJsxElementContext , isNextTokenNotCloseBracket ] , RuleAction . Space ) ,
235
- rule ( "NoSpaceAfterComma" , SyntaxKind . CommaToken , anyToken , [ isOptionDisabledOrUndefined ( "insertSpaceAfterCommaDelimiter" ) , isNonJsxSameLineTokenContext , isNonJsxElementContext ] , RuleAction . Delete ) ,
234
+ rule ( "SpaceAfterComma" , SyntaxKind . CommaToken , anyToken , [ isOptionEnabled ( "insertSpaceAfterCommaDelimiter" ) , isNonJsxSameLineTokenContext , isNonJsxElementOrFragmentContext , isNextTokenNotCloseBracket ] , RuleAction . Space ) ,
235
+ rule ( "NoSpaceAfterComma" , SyntaxKind . CommaToken , anyToken , [ isOptionDisabledOrUndefined ( "insertSpaceAfterCommaDelimiter" ) , isNonJsxSameLineTokenContext , isNonJsxElementOrFragmentContext ] , RuleAction . Delete ) ,
236
236
237
237
// Insert space after function keyword for anonymous functions
238
238
rule ( "SpaceAfterAnonymousFunctionKeyword" , SyntaxKind . FunctionKeyword , SyntaxKind . OpenParenToken , [ isOptionEnabled ( "insertSpaceAfterFunctionKeywordForAnonymousFunctions" ) , isFunctionDeclContext ] , RuleAction . Space ) ,
@@ -319,7 +319,7 @@ namespace ts.formatting {
319
319
"SpaceBetweenStatements" ,
320
320
[ SyntaxKind . CloseParenToken , SyntaxKind . DoKeyword , SyntaxKind . ElseKeyword , SyntaxKind . CaseKeyword ] ,
321
321
anyToken ,
322
- [ isNonJsxSameLineTokenContext , isNonJsxElementContext , isNotForContext ] ,
322
+ [ isNonJsxSameLineTokenContext , isNonJsxElementOrFragmentContext , isNotForContext ] ,
323
323
RuleAction . Space ) ,
324
324
// This low-pri rule takes care of "try {" and "finally {" in case the rule SpaceBeforeOpenBraceInControl didn't execute on FormatOnEnter.
325
325
rule ( "SpaceAfterTryFinally" , [ SyntaxKind . TryKeyword , SyntaxKind . FinallyKeyword ] , SyntaxKind . OpenBraceToken , [ isNonJsxSameLineTokenContext ] , RuleAction . Space ) ,
@@ -614,8 +614,8 @@ namespace ts.formatting {
614
614
return context . TokensAreOnSameLine ( ) && context . contextNode . kind !== SyntaxKind . JsxText ;
615
615
}
616
616
617
- function isNonJsxElementContext ( context : FormattingContext ) : boolean {
618
- return context . contextNode . kind !== SyntaxKind . JsxElement ;
617
+ function isNonJsxElementOrFragmentContext ( context : FormattingContext ) : boolean {
618
+ return context . contextNode . kind !== SyntaxKind . JsxElement && context . contextNode . kind !== SyntaxKind . JsxFragment ;
619
619
}
620
620
621
621
function isJsxExpressionContext ( context : FormattingContext ) : boolean {
0 commit comments