mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 06:35:35 -05:00
fix no space before equal operator in type parameter (#29990)
fix no space before equal operator in type parameter
This commit is contained in:
@@ -442,7 +442,7 @@ namespace ts.formatting {
|
||||
case SyntaxKind.ForInStatement:
|
||||
// "in" keyword in [P in keyof T]: T[P]
|
||||
case SyntaxKind.TypeParameter:
|
||||
return context.currentTokenSpan.kind === SyntaxKind.InKeyword || context.nextTokenSpan.kind === SyntaxKind.InKeyword;
|
||||
return context.currentTokenSpan.kind === SyntaxKind.InKeyword || context.nextTokenSpan.kind === SyntaxKind.InKeyword || context.currentTokenSpan.kind === SyntaxKind.EqualsToken || context.nextTokenSpan.kind === SyntaxKind.EqualsToken;
|
||||
// Technically, "of" is not a binary operator, but format it the same way as "in"
|
||||
case SyntaxKind.ForOfStatement:
|
||||
return context.currentTokenSpan.kind === SyntaxKind.OfKeyword || context.nextTokenSpan.kind === SyntaxKind.OfKeyword;
|
||||
|
||||
Reference in New Issue
Block a user