@@ -61,6 +61,7 @@ import { SourcePlugin } from "./plugins/SourcePlugin.js";
61
61
import { TypePlugin } from "./plugins/TypePlugin.js" ;
62
62
import { IncludePlugin } from "./plugins/IncludePlugin.js" ;
63
63
import { MergeModuleWithPlugin } from "./plugins/MergeModuleWithPlugin.js" ;
64
+ import { resolveAliasedSymbol } from "./utils/symbols.js" ;
64
65
65
66
export interface ConverterEvents {
66
67
begin : [ Context ] ;
@@ -330,7 +331,13 @@ export class Converter extends AbstractComponent<Application, ConverterEvents> {
330
331
this . resolve ( context ) ;
331
332
332
333
this . trigger ( Converter . EVENT_END , context ) ;
333
- this . _config = undefined ;
334
+
335
+ // Delete caches of options so that test usage which changes options
336
+ // doesn't have confusing behavior where tests run in isolation work
337
+ // but break when run as a batch.
338
+ delete this . _config ;
339
+ delete this . excludeCache ;
340
+ delete this . externalPatternCache ;
334
341
335
342
return project ;
336
343
}
@@ -613,12 +620,13 @@ export class Converter extends AbstractComponent<Application, ConverterEvents> {
613
620
* information at this point since comment discovery hasn't happened.
614
621
* @internal
615
622
*/
616
- shouldIgnore ( symbol : ts . Symbol ) {
623
+ shouldIgnore ( symbol : ts . Symbol , checker : ts . TypeChecker ) {
624
+ symbol = resolveAliasedSymbol ( symbol , checker ) ;
617
625
if ( this . isExcluded ( symbol ) ) {
618
626
return true ;
619
627
}
620
628
621
- return this . excludeExternals && this . isExternal ( symbol ) ;
629
+ return this . excludeExternals && this . isExternal ( symbol , checker ) ;
622
630
}
623
631
624
632
private isExcluded ( symbol : ts . Symbol ) {
@@ -631,11 +639,11 @@ export class Converter extends AbstractComponent<Application, ConverterEvents> {
631
639
}
632
640
633
641
/** @internal */
634
- isExternal ( symbol : ts . Symbol ) {
642
+ isExternal ( symbol : ts . Symbol , checker : ts . TypeChecker ) {
635
643
this . externalPatternCache ??= new MinimatchSet ( this . externalPattern ) ;
636
644
const cache = this . externalPatternCache ;
637
645
638
- const declarations = symbol . getDeclarations ( ) ;
646
+ const declarations = resolveAliasedSymbol ( symbol , checker ) . getDeclarations ( ) ;
639
647
640
648
// `undefined` has no declarations, if someone does `export default undefined`
641
649
// the symbol ends up as having no declarations (the export symbol does, but
0 commit comments