Skip to content

Commit

Permalink
feat: Add disableAliases option (#1576)
Browse files Browse the repository at this point in the history
Resolves #1571
  • Loading branch information
Unnvaldr committed Apr 24, 2021
1 parent 8aad0d5 commit a446431
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib/converter/symbols.ts
Expand Up @@ -73,6 +73,7 @@ export function convertSymbol(
// but aren't aliased symbols because `export *` was used.
const previous = context.project.getReflectionFromSymbol(symbol);
if (
!context.converter.application.options.getValue("disableAliases") &&
previous &&
previous.parent?.kindOf(ReflectionKind.Module | ReflectionKind.Project)
) {
Expand Down Expand Up @@ -704,7 +705,10 @@ function convertAlias(
const reflection = context.project.getReflectionFromSymbol(
context.resolveAliasedSymbol(symbol)
);
if (!reflection) {
if (
!reflection ||
context.converter.application.options.getValue("disableAliases")
) {
// We don't have this, convert it.
convertSymbol(
context,
Expand Down
1 change: 1 addition & 0 deletions src/lib/utils/options/declaration.ts
Expand Up @@ -46,6 +46,7 @@ export interface TypeDocOptionMap {
excludeNotDocumented: boolean;
excludeInternal: boolean;
disableSources: boolean;
disableAliases: boolean;
includes: string;
media: string;

Expand Down
5 changes: 5 additions & 0 deletions src/lib/utils/options/sources/typedoc.ts
Expand Up @@ -72,6 +72,11 @@ export function addTypeDocOptions(options: Pick<Options, "addDeclaration">) {
"Disables setting the source of a reflection when documenting it.",
type: ParameterType.Boolean,
});
options.addDeclaration({
name: "disableAliases",
help: "Disables creating aliases for shared reflections.",
type: ParameterType.Boolean,
});
options.addDeclaration({
name: "includes",
help:
Expand Down

0 comments on commit a446431

Please sign in to comment.