mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00: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:
1 parent
e0e2f5bd41
commit
4cfb7a5105
2 files changed
+39
-1
No files matched your search
@@ -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