@@ -1840,6 +1840,7 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri
1840
1840
if ( hint === EmitHint . IdentifierName ) return emitIdentifier ( cast ( node , isIdentifier ) ) ;
1841
1841
if ( hint === EmitHint . JsxAttributeValue ) return emitLiteral ( cast ( node , isStringLiteral ) , /*jsxAttributeEscape*/ true ) ;
1842
1842
if ( hint === EmitHint . MappedTypeParameter ) return emitMappedTypeParameter ( cast ( node , isTypeParameterDeclaration ) ) ;
1843
+ if ( hint === EmitHint . TypeImportAttributes ) return emitTypeImportAttributes ( cast ( node , ts . isImportAttributes ) ) ;
1843
1844
if ( hint === EmitHint . EmbeddedStatement ) {
1844
1845
Debug . assertNode ( node , isEmptyStatement ) ;
1845
1846
return emitEmptyStatement ( /*isEmbeddedStatement*/ true ) ;
@@ -2944,15 +2945,7 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri
2944
2945
if ( node . attributes ) {
2945
2946
writePunctuation ( "," ) ;
2946
2947
writeSpace ( ) ;
2947
- writePunctuation ( "{" ) ;
2948
- writeSpace ( ) ;
2949
- writeKeyword ( node . attributes . token === SyntaxKind . AssertKeyword ? "assert" : "with" ) ;
2950
- writePunctuation ( ":" ) ;
2951
- writeSpace ( ) ;
2952
- const elements = node . attributes . elements ;
2953
- emitList ( node . attributes , elements , ListFormat . ImportAttributes ) ;
2954
- writeSpace ( ) ;
2955
- writePunctuation ( "}" ) ;
2948
+ pipelineEmit ( EmitHint . TypeImportAttributes , node . attributes ) ;
2956
2949
}
2957
2950
writePunctuation ( ")" ) ;
2958
2951
if ( node . qualifier ) {
@@ -4077,6 +4070,18 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri
4077
4070
writeTrailingSemicolon ( ) ;
4078
4071
}
4079
4072
4073
+ function emitTypeImportAttributes ( node : ImportAttributes ) {
4074
+ writePunctuation ( "{" ) ;
4075
+ writeSpace ( ) ;
4076
+ writeKeyword ( node . token === SyntaxKind . AssertKeyword ? "assert" : "with" ) ;
4077
+ writePunctuation ( ":" ) ;
4078
+ writeSpace ( ) ;
4079
+ const elements = node . elements ;
4080
+ emitList ( node , elements , ListFormat . ImportAttributes ) ;
4081
+ writeSpace ( ) ;
4082
+ writePunctuation ( "}" ) ;
4083
+ }
4084
+
4080
4085
function emitImportAttributes ( node : ImportAttributes ) {
4081
4086
emitTokenWithComment ( node . token , node . pos , writeKeyword , node ) ;
4082
4087
writeSpace ( ) ;
0 commit comments