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

@internal in JavaScript / TypeScript JSDoc comments #49367

Open
Bistard opened this issue Jun 2, 2022 · 1 comment
Open

@internal in JavaScript / TypeScript JSDoc comments #49367

Bistard opened this issue Jun 2, 2022 · 1 comment
Labels
Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature Suggestion An idea for TypeScript

Comments

@Bistard
Copy link

Bistard commented Jun 2, 2022

Description

When people are writing a multiline comment, we may mark it as @internal. when the classes or functions marked as internal are exported and used outside of their own files, there will render a strikethrough on the text (Just like how @deprecated works), saying this class/function is marked as internal and not supposed to be used directly in other modules.

image
image

Reason

The reason I have to export these functions or classes is that I need to write unit tests for them. They are not intended to be used directly.

When I am reading the source code of VSCode, I also realized some exported classes have comments such as DO NOT USE DIRECTLY because these are used for unit testing, which having the same reason that I have.

I think this may decrease the chances for other programmers that accidentally use them.

@mjbvz mjbvz transferred this issue from microsoft/vscode Jun 2, 2022
@mjbvz mjbvz changed the title @internal in JavaScript / TypeScript multiline comments @internal in JavaScript / TypeScript JSDoc comments Jun 2, 2022
@RyanCavanaugh RyanCavanaugh added Suggestion An idea for TypeScript Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature labels Jun 9, 2022
@Bistard
Copy link
Author

Bistard commented Jun 14, 2022

Actually, I think using the keyword internal is not a good choice. It is already been used widely and people use them with various meanings, in this case, we can't really just define this word on our own. Maybe testonly or something similar is more practical.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

2 participants