Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add disableAliases option #1576

Merged
merged 7 commits into from Apr 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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