@@ -52,7 +52,7 @@ namespace ts.formatting {
5252
5353 rule ( "NotSpaceBeforeColon" , anyToken , SyntaxKind . ColonToken , [ isNonJsxSameLineTokenContext , isNotBinaryOpContext , isNotTypeAnnotationContext ] , RuleAction . DeleteSpace ) ,
5454 rule ( "SpaceAfterColon" , SyntaxKind . ColonToken , anyToken , [ isNonJsxSameLineTokenContext , isNotBinaryOpContext ] , RuleAction . InsertSpace ) ,
55- rule ( "NoSpaceBeforeQuestionMark" , anyToken , SyntaxKind . QuestionToken , [ isNonJsxSameLineTokenContext , isNotBinaryOpContext ] , RuleAction . DeleteSpace ) ,
55+ rule ( "NoSpaceBeforeQuestionMark" , anyToken , SyntaxKind . QuestionToken , [ isNonJsxSameLineTokenContext , isNotBinaryOpContext , isNotTypeAnnotationContext ] , RuleAction . DeleteSpace ) ,
5656 // insert space after '?' only when it is used in conditional operator
5757 rule ( "SpaceAfterQuestionMarkInConditionalOperator" , SyntaxKind . QuestionToken , anyToken , [ isNonJsxSameLineTokenContext , isConditionalOperatorContext ] , RuleAction . InsertSpace ) ,
5858
@@ -315,8 +315,9 @@ namespace ts.formatting {
315315 rule ( "SpaceAfterTypeAssertion" , SyntaxKind . GreaterThanToken , anyToken , [ isOptionEnabled ( "insertSpaceAfterTypeAssertion" ) , isNonJsxSameLineTokenContext , isTypeAssertionContext ] , RuleAction . InsertSpace ) ,
316316 rule ( "NoSpaceAfterTypeAssertion" , SyntaxKind . GreaterThanToken , anyToken , [ isOptionDisabledOrUndefined ( "insertSpaceAfterTypeAssertion" ) , isNonJsxSameLineTokenContext , isTypeAssertionContext ] , RuleAction . DeleteSpace ) ,
317317
318- rule ( "SpaceBeforeTypeAnnotation" , anyToken , SyntaxKind . ColonToken , [ isOptionEnabled ( "insertSpaceBeforeTypeAnnotation" ) , isNonJsxSameLineTokenContext , isTypeAnnotationContext ] , RuleAction . InsertSpace ) ,
319- rule ( "NoSpaceBeforeTypeAnnotation" , anyToken , SyntaxKind . ColonToken , [ isOptionDisabledOrUndefined ( "insertSpaceBeforeTypeAnnotation" ) , isNonJsxSameLineTokenContext , isTypeAnnotationContext ] , RuleAction . DeleteSpace ) ,
318+ rule ( "SpaceBeforeTypeAnnotation" , anyToken , [ SyntaxKind . QuestionToken , SyntaxKind . ColonToken ] , [ isOptionEnabled ( "insertSpaceBeforeTypeAnnotation" ) , isNonJsxSameLineTokenContext , isTypeAnnotationContext ] , RuleAction . InsertSpace ) ,
319+ rule ( "NoSpaceBeforeTypeAnnotation" , anyToken , [ SyntaxKind . QuestionToken , SyntaxKind . ColonToken ] , [ isOptionDisabledOrUndefined ( "insertSpaceBeforeTypeAnnotation" ) , isNonJsxSameLineTokenContext , isTypeAnnotationContext ] , RuleAction . DeleteSpace ) ,
320+
320321 rule ( "NoOptionalSemicolon" , SyntaxKind . SemicolonToken , anyTokenIncludingEOF , [ optionEquals ( "semicolons" , SemicolonPreference . Remove ) , isSemicolonDeletionContext ] , RuleAction . DeleteToken ) ,
321322 rule ( "OptionalSemicolon" , anyToken , anyTokenIncludingEOF , [ optionEquals ( "semicolons" , SemicolonPreference . Insert ) , isSemicolonInsertionContext ] , RuleAction . InsertTrailingSemicolon ) ,
322323 ] ;
0 commit comments