@@ -394,6 +394,10 @@ export type ClassValue =
394
394
code : 'type Foo = typeof bar;' ,
395
395
options : [ { allowAliases : 'always' } ] ,
396
396
} ,
397
+ {
398
+ code : "type Foo = typeof import('foo');" ,
399
+ options : [ { allowAliases : 'always' } ] ,
400
+ } ,
397
401
{
398
402
code : `
399
403
const WithAKey = { AKey: true };
@@ -405,6 +409,10 @@ type KeyNames = keyof typeof SCALARS;
405
409
code : 'type Foo = typeof bar | typeof baz;' ,
406
410
options : [ { allowAliases : 'in-unions' } ] ,
407
411
} ,
412
+ {
413
+ code : "type Foo = typeof bar | typeof import('foo');" ,
414
+ options : [ { allowAliases : 'in-unions' } ] ,
415
+ } ,
408
416
{
409
417
code : 'type Foo = keyof [string];' ,
410
418
options : [ { allowTupleTypes : 'always' } ] ,
@@ -505,6 +513,20 @@ type KeyNames = keyof typeof SCALARS;
505
513
} ,
506
514
] ,
507
515
} ,
516
+ {
517
+ code : "type Foo = typeof import('foo');" ,
518
+ options : [ { allowAliases : 'never' } ] ,
519
+ errors : [
520
+ {
521
+ messageId : 'noTypeAlias' ,
522
+ data : {
523
+ alias : 'aliases' ,
524
+ } ,
525
+ line : 1 ,
526
+ column : 12 ,
527
+ } ,
528
+ ] ,
529
+ } ,
508
530
{
509
531
code : "type Foo = 'a' | 'b';" ,
510
532
errors : [
@@ -528,6 +550,29 @@ type KeyNames = keyof typeof SCALARS;
528
550
} ,
529
551
] ,
530
552
} ,
553
+ {
554
+ code : "type Foo = 'a' | typeof import('foo');" ,
555
+ errors : [
556
+ {
557
+ messageId : 'noCompositionAlias' ,
558
+ data : {
559
+ typeName : 'Aliases' ,
560
+ compositionType : 'union' ,
561
+ } ,
562
+ line : 1 ,
563
+ column : 12 ,
564
+ } ,
565
+ {
566
+ messageId : 'noCompositionAlias' ,
567
+ data : {
568
+ typeName : 'Aliases' ,
569
+ compositionType : 'union' ,
570
+ } ,
571
+ line : 1 ,
572
+ column : 18 ,
573
+ } ,
574
+ ] ,
575
+ } ,
531
576
{
532
577
code : "type Foo = 'a' | 'b';" ,
533
578
options : [ { allowLiterals : 'in-unions' } ] ,
0 commit comments