@@ -42,6 +42,7 @@ const VARIABLE_DECLARATION = 'VariableDeclaration'
42
42
const FUNCTION_DECLARATION = 'FunctionDeclaration'
43
43
const CLASS_DECLARATION = 'ClassDeclaration'
44
44
const DEFAULT = 'default'
45
+ const TYPE_ALIAS = 'TypeAlias'
45
46
46
47
let preparationDone = false
47
48
const importList = new Map ( )
@@ -391,6 +392,7 @@ module.exports = {
391
392
}
392
393
393
394
exports = exportList . get ( file )
395
+ console . log ( 'file: ' , file )
394
396
395
397
// special case: export * from
396
398
const exportAll = exports . get ( EXPORT_ALL_DECLARATION )
@@ -409,8 +411,10 @@ module.exports = {
409
411
}
410
412
411
413
const exportStatement = exports . get ( exportedValue )
414
+ console . log ( 'exportStatement: ' , exportStatement )
412
415
413
416
const value = exportedValue === IMPORT_DEFAULT_SPECIFIER ? DEFAULT : exportedValue
417
+ console . log ( 'value: ' , value )
414
418
415
419
if ( typeof exportStatement !== 'undefined' ) {
416
420
if ( exportStatement . whereUsed . size < 1 ) {
@@ -463,7 +467,8 @@ module.exports = {
463
467
if ( declaration ) {
464
468
if (
465
469
declaration . type === FUNCTION_DECLARATION ||
466
- declaration . type === CLASS_DECLARATION
470
+ declaration . type === CLASS_DECLARATION ||
471
+ declaration . type === TYPE_ALIAS
467
472
) {
468
473
newExportIdentifiers . add ( declaration . id . name )
469
474
}
@@ -788,7 +793,8 @@ module.exports = {
788
793
if ( node . declaration ) {
789
794
if (
790
795
node . declaration . type === FUNCTION_DECLARATION ||
791
- node . declaration . type === CLASS_DECLARATION
796
+ node . declaration . type === CLASS_DECLARATION ||
797
+ node . declaration . type === TYPE_ALIAS
792
798
) {
793
799
checkUsage ( node , node . declaration . id . name )
794
800
}
0 commit comments