@@ -85,6 +85,9 @@ export function loadConverters() {
85
85
tupleConverter ,
86
86
typeOperatorConverter ,
87
87
unionConverter ,
88
+ // Only used if skipLibCheck: true
89
+ jsDocNullableTypeConverter ,
90
+ jsDocNonNullableTypeConverter ,
88
91
] ) {
89
92
for ( const key of actor . kind ) {
90
93
if ( key === undefined ) {
@@ -986,6 +989,27 @@ const unionConverter: TypeConverter<ts.UnionTypeNode, ts.UnionType> = {
986
989
} ,
987
990
} ;
988
991
992
+ const jsDocNullableTypeConverter : TypeConverter < ts . JSDocNullableType > = {
993
+ kind : [ ts . SyntaxKind . JSDocNullableType ] ,
994
+ convert ( context , node ) {
995
+ return new UnionType ( [
996
+ convertType ( context , node . type ) ,
997
+ new LiteralType ( null ) ,
998
+ ] ) ;
999
+ } ,
1000
+ // Should be a UnionType
1001
+ convertType : requestBugReport ,
1002
+ } ;
1003
+
1004
+ const jsDocNonNullableTypeConverter : TypeConverter < ts . JSDocNonNullableType > = {
1005
+ kind : [ ts . SyntaxKind . JSDocNonNullableType ] ,
1006
+ convert ( context , node ) {
1007
+ return convertType ( context , node . type ) ;
1008
+ } ,
1009
+ // Should be a UnionType
1010
+ convertType : requestBugReport ,
1011
+ } ;
1012
+
989
1013
function requestBugReport ( context : Context , nodeOrType : ts . Node | ts . Type ) {
990
1014
if ( "kind" in nodeOrType ) {
991
1015
const kindName = ts . SyntaxKind [ nodeOrType . kind ] ;
0 commit comments