mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 21:36:50 -05:00
Fix space issue in mapped type formatting (#21712)
* Add the test for mapped type formatting issue * Fix inconsistent number of spaces within braces when formatting mapped types
This commit is contained in:
committed by
Mohamed Hegazy
parent
e0e2f5bd41
commit
4cfb7a5105
@@ -469,7 +469,9 @@ namespace ts.formatting {
|
||||
}
|
||||
|
||||
function isBraceWrappedContext(context: FormattingContext): boolean {
|
||||
return context.contextNode.kind === SyntaxKind.ObjectBindingPattern || isSingleLineBlockContext(context);
|
||||
return context.contextNode.kind === SyntaxKind.ObjectBindingPattern ||
|
||||
context.contextNode.kind === SyntaxKind.MappedType ||
|
||||
isSingleLineBlockContext(context);
|
||||
}
|
||||
|
||||
// This check is done before an open brace in a control construct, a function, or a typescript block declaration
|
||||
|
||||
Reference in New Issue
Block a user