@@ -61,6 +61,7 @@ import { SourcePlugin } from "./plugins/SourcePlugin.js";
6161import { TypePlugin } from "./plugins/TypePlugin.js" ;
6262import { IncludePlugin } from "./plugins/IncludePlugin.js" ;
6363import { MergeModuleWithPlugin } from "./plugins/MergeModuleWithPlugin.js" ;
64+ import { resolveAliasedSymbol } from "./utils/symbols.js" ;
6465
6566export interface ConverterEvents {
6667 begin : [ Context ] ;
@@ -330,7 +331,13 @@ export class Converter extends AbstractComponent<Application, ConverterEvents> {
330331 this . resolve ( context ) ;
331332
332333 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 ;
334341
335342 return project ;
336343 }
@@ -613,12 +620,13 @@ export class Converter extends AbstractComponent<Application, ConverterEvents> {
613620 * information at this point since comment discovery hasn't happened.
614621 * @internal
615622 */
616- shouldIgnore ( symbol : ts . Symbol ) {
623+ shouldIgnore ( symbol : ts . Symbol , checker : ts . TypeChecker ) {
624+ symbol = resolveAliasedSymbol ( symbol , checker ) ;
617625 if ( this . isExcluded ( symbol ) ) {
618626 return true ;
619627 }
620628
621- return this . excludeExternals && this . isExternal ( symbol ) ;
629+ return this . excludeExternals && this . isExternal ( symbol , checker ) ;
622630 }
623631
624632 private isExcluded ( symbol : ts . Symbol ) {
@@ -631,11 +639,11 @@ export class Converter extends AbstractComponent<Application, ConverterEvents> {
631639 }
632640
633641 /** @internal */
634- isExternal ( symbol : ts . Symbol ) {
642+ isExternal ( symbol : ts . Symbol , checker : ts . TypeChecker ) {
635643 this . externalPatternCache ??= new MinimatchSet ( this . externalPattern ) ;
636644 const cache = this . externalPatternCache ;
637645
638- const declarations = symbol . getDeclarations ( ) ;
646+ const declarations = resolveAliasedSymbol ( symbol , checker ) . getDeclarations ( ) ;
639647
640648 // `undefined` has no declarations, if someone does `export default undefined`
641649 // the symbol ends up as having no declarations (the export symbol does, but
0 commit comments