@@ -2606,6 +2606,82 @@ function printPathNoParens(path, options, print, args) {
26062606 return concat ( parts ) ;
26072607 }
26082608
2609+ case "EnumDeclaration" :
2610+ return concat ( [
2611+ "enum " ,
2612+ path . call ( print , "id" ) ,
2613+ " " ,
2614+ path . call ( print , "body" )
2615+ ] ) ;
2616+ case "EnumBooleanBody" :
2617+ case "EnumNumberBody" :
2618+ case "EnumStringBody" :
2619+ case "EnumSymbolBody" : {
2620+ if ( n . type === "EnumSymbolBody" || n . explicitType ) {
2621+ let type = null ;
2622+ switch ( n . type ) {
2623+ case "EnumBooleanBody" :
2624+ type = "boolean" ;
2625+ break ;
2626+ case "EnumNumberBody" :
2627+ type = "number" ;
2628+ break ;
2629+ case "EnumStringBody" :
2630+ type = "string" ;
2631+ break ;
2632+ case "EnumSymbolBody" :
2633+ type = "symbol" ;
2634+ break ;
2635+ }
2636+ parts . push ( "of " , type , " " ) ;
2637+ }
2638+ if ( n . members . length === 0 ) {
2639+ parts . push (
2640+ group (
2641+ concat ( [
2642+ "{" ,
2643+ comments . printDanglingComments ( path , options ) ,
2644+ softline ,
2645+ "}"
2646+ ] )
2647+ )
2648+ ) ;
2649+ } else {
2650+ parts . push (
2651+ group (
2652+ concat ( [
2653+ "{" ,
2654+ indent (
2655+ concat ( [
2656+ hardline ,
2657+ printArrayItems ( path , options , "members" , print ) ,
2658+ shouldPrintComma ( options ) ? "," : ""
2659+ ] )
2660+ ) ,
2661+ comments . printDanglingComments (
2662+ path ,
2663+ options ,
2664+ /* sameIndent */ true
2665+ ) ,
2666+ hardline ,
2667+ "}"
2668+ ] )
2669+ )
2670+ ) ;
2671+ }
2672+ return concat ( parts ) ;
2673+ }
2674+ case "EnumBooleanMember" :
2675+ case "EnumNumberMember" :
2676+ case "EnumStringMember" :
2677+ return concat ( [
2678+ path . call ( print , "id" ) ,
2679+ " = " ,
2680+ typeof n . init === "object" ? path . call ( print , "init" ) : String ( n . init )
2681+ ] ) ;
2682+ case "EnumDefaultedMember" :
2683+ return path . call ( print , "id" ) ;
2684+
26092685 case "FunctionTypeAnnotation" :
26102686 case "TSFunctionType" : {
26112687 // FunctionTypeAnnotation is ambiguous:
0 commit comments