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

Declare types for node builtins modules within REPL virtual file #1424

Closed
cspotcode opened this issue Aug 8, 2021 · 0 comments · Fixed by #1500
Closed

Declare types for node builtins modules within REPL virtual file #1424

cspotcode opened this issue Aug 8, 2021 · 0 comments · Fixed by #1500
Milestone

Comments

@cspotcode
Copy link
Collaborator

Node lets you do util.promisify() within the REPL without importing util because it declares getters for each builtin module.

However, ts-node doesn't tell typescript about these getters, so you'll still get TS errors if you try to util.promisify

We can add a bunch of declare const to the top of the REPL file so that all built-ins are declared.

Limitations:

  • Should gracefully skip when @types/node is not available
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant