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

[TS 4.3.0 beta] Private getters and private static getters showing up in generated docs #1564

Closed
zajrik opened this issue Apr 2, 2021 · 0 comments
Labels
bug Functionality does not match expectation

Comments

@zajrik
Copy link

zajrik commented Apr 2, 2021

Search terms

private getter, private static getter

Expected Behavior

I know it's unreasonable to expect TypeDoc to support features of the TS beta that just released yesterday, I just wanted to put this on the radar to be sure it will be addressed when the time comes to support TS 4.3.0.

Currently, when generating documentation for a class that implements private and private static members using # syntax, the members are correctly not displayed in the documentation when excludePrivate is true in the TypeDoc config. I would expect the same for private getters and private static getters

Actual Behavior

Private getters and private static getters are output in the documentation

image
image

Steps to reproduce the bug

Generate documentation for the following code with excludePrivate set to true

export class CommandCache
{
	static #staticInstance: CommandCache;
	readonly #cache: Map<string, Command>;

	private constructor()
	{
		if (typeof CommandCache.#staticInstance !== 'undefined')
			throw new Error('Cannot create multiple instances of CommandCache');

		this.#cache = new Map();
		CommandCache.#staticInstance = this;
		console.log(this.#foo);
	}

	static get #instance(): CommandCache
	{
		return CommandCache.#staticInstance ?? new CommandCache();
	}

	get #foo(): string
	{
		return 'foo';
	}
}

I excluded most of the irrelevant members from the example code, but you can see it does contain a non-getter private member and a static non-getter private member that are correctly excluded from the generated documentation.

Environment

  • Typedoc version: 0.20.34
  • TypeScript version: 4.3.0-beta
  • Node.js version: 14.15.3
  • OS: Ubuntu 20.04.2 LTS on Windows 10 x86_64
@zajrik zajrik added the bug Functionality does not match expectation label Apr 2, 2021
@Gerrit0 Gerrit0 closed this as completed in d1a9bca Apr 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality does not match expectation
Projects
None yet
Development

No branches or pull requests

1 participant