@@ -59,7 +59,7 @@ namespace ts.formatting {
59
59
// in other cases there should be no space between '?' and next token
60
60
rule ( "NoSpaceAfterQuestionMark" , SyntaxKind . QuestionToken , anyToken , [ isNonJsxSameLineTokenContext ] , RuleAction . DeleteSpace ) ,
61
61
62
- rule ( "NoSpaceBeforeDot" , anyToken , [ SyntaxKind . DotToken , SyntaxKind . QuestionDotToken ] , [ isNonJsxSameLineTokenContext , isNotPropertyAccessOnNumericLiteral ] , RuleAction . DeleteSpace ) ,
62
+ rule ( "NoSpaceBeforeDot" , anyToken , [ SyntaxKind . DotToken , SyntaxKind . QuestionDotToken ] , [ isNonJsxSameLineTokenContext , isNotPropertyAccessOnIntegerLiteral ] , RuleAction . DeleteSpace ) ,
63
63
rule ( "NoSpaceAfterDot" , [ SyntaxKind . DotToken , SyntaxKind . QuestionDotToken ] , anyToken , [ isNonJsxSameLineTokenContext ] , RuleAction . DeleteSpace ) ,
64
64
65
65
rule ( "NoSpaceBetweenImportParenInImportType" , SyntaxKind . ImportKeyword , SyntaxKind . OpenParenToken , [ isNonJsxSameLineTokenContext , isImportTypeContext ] , RuleAction . DeleteSpace ) ,
@@ -894,7 +894,9 @@ namespace ts.formatting {
894
894
return positionIsASICandidate ( context . currentTokenSpan . end , context . currentTokenParent , context . sourceFile ) ;
895
895
}
896
896
897
- function isNotPropertyAccessOnNumericLiteral ( context : FormattingContext ) : boolean {
898
- return ! isPropertyAccessExpression ( context . contextNode ) || ! isNumericLiteral ( context . contextNode . expression ) ;
897
+ function isNotPropertyAccessOnIntegerLiteral ( context : FormattingContext ) : boolean {
898
+ return ! isPropertyAccessExpression ( context . contextNode )
899
+ || ! isNumericLiteral ( context . contextNode . expression )
900
+ || context . contextNode . expression . getText ( ) . indexOf ( "." ) !== - 1 ;
899
901
}
900
902
}
0 commit comments