@@ -240,11 +240,12 @@ export function getAllRules(): RuleSpec[] {
240
240
rule ( "NoSpaceBetweenCloseParenAndAngularBracket" , SyntaxKind . CloseParenToken , SyntaxKind . LessThanToken , [ isNonJsxSameLineTokenContext , isTypeArgumentOrParameterOrAssertionContext ] , RuleAction . DeleteSpace ) ,
241
241
rule ( "NoSpaceAfterOpenAngularBracket" , SyntaxKind . LessThanToken , anyToken , [ isNonJsxSameLineTokenContext , isTypeArgumentOrParameterOrAssertionContext ] , RuleAction . DeleteSpace ) ,
242
242
rule ( "NoSpaceBeforeCloseAngularBracket" , anyToken , SyntaxKind . GreaterThanToken , [ isNonJsxSameLineTokenContext , isTypeArgumentOrParameterOrAssertionContext ] , RuleAction . DeleteSpace ) ,
243
- rule ( "NoSpaceAfterCloseAngularBracket" ,
244
- SyntaxKind . GreaterThanToken ,
245
- [ SyntaxKind . OpenParenToken , SyntaxKind . OpenBracketToken , SyntaxKind . GreaterThanToken , SyntaxKind . CommaToken ] ,
246
- [ isNonJsxSameLineTokenContext , isTypeArgumentOrParameterOrAssertionContext , isNotFunctionDeclContext /*To prevent an interference with the SpaceBeforeOpenParenInFuncDecl rule*/ ] ,
247
- RuleAction . DeleteSpace ) ,
243
+ rule ( "NoSpaceAfterCloseAngularBracket" , SyntaxKind . GreaterThanToken , [ SyntaxKind . OpenParenToken , SyntaxKind . OpenBracketToken , SyntaxKind . GreaterThanToken , SyntaxKind . CommaToken ] , [
244
+ isNonJsxSameLineTokenContext ,
245
+ isTypeArgumentOrParameterOrAssertionContext ,
246
+ isNotFunctionDeclContext /*To prevent an interference with the SpaceBeforeOpenParenInFuncDecl rule*/ ,
247
+ isNonTypeAssertionContext
248
+ ] , RuleAction . DeleteSpace ) ,
248
249
249
250
// decorators
250
251
rule ( "SpaceBeforeAt" , [ SyntaxKind . CloseParenToken , SyntaxKind . Identifier ] , SyntaxKind . AtToken , [ isNonJsxSameLineTokenContext ] , RuleAction . InsertSpace ) ,
@@ -835,6 +836,10 @@ function isTypeAssertionContext(context: FormattingContext): boolean {
835
836
return context . contextNode . kind === SyntaxKind . TypeAssertionExpression ;
836
837
}
837
838
839
+ function isNonTypeAssertionContext ( context : FormattingContext ) : boolean {
840
+ return ! isTypeAssertionContext ( context ) ;
841
+ }
842
+
838
843
function isVoidOpContext ( context : FormattingContext ) : boolean {
839
844
return context . currentTokenSpan . kind === SyntaxKind . VoidKeyword && context . currentTokenParent . kind === SyntaxKind . VoidExpression ;
840
845
}
0 commit comments