-
Notifications
You must be signed in to change notification settings - Fork 9
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
Improve TypeScript suggestions #1130
Improve TypeScript suggestions #1130
Conversation
TypeScript's autocomplete will suggest pretty much any symbol that is transitively exported in your package. This includes a lot of internal functions and objects that exist for no-op or testing purposes and should not be used by customers. Use the `@internal` JSDoc annotation and the `stripInternal` option in `tsconfig.json` to avoid internal functions from being declared in the `.d.ts` files, preventing TypeScript's autocomplete from suggesting them. Added on top of the changes in #1123, which should be merged first.
5a112d4
to
5cd4f91
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs for stripInternal says:
This is an internal compiler option; use at your own risk, because the compiler does not check that the result is valid.
It's probably fine for now.
It suggest using api-extractor. Is that something we want to look at?
@tombruijn It's probably a good idea to look into Created an issue for it: #1131 |
This comment has been minimized.
This comment has been minimized.
Hi @unflxw, We've found some issues with your Pull Request.
|
This is a message from the daily scheduled checks. |
This is probably incomplete, as I have attempted to, in doubt, err on the side of caution and avoid removing a symbol that is potentially useful to the customer. Please point out any symbols I have missed.
Use @internal to improve suggestions
TypeScript's autocomplete will suggest pretty much any symbol that
is transitively exported in your package. This includes a lot of
internal functions and objects that exist for no-op or testing
purposes and should not be used by customers.
Use the
@internal
JSDoc annotation and thestripInternal
optionin
tsconfig.json
to avoid internal functions from being declaredin the
.d.ts
files, preventing TypeScript's autocomplete fromsuggesting them.
Added on top of the changes in #1123, which should be merged first. See implement-heartbeat-checkins...improve-typescript-suggestions for a good diff.