Can someone help me figure out how to get Node definitions in TS working? I installed @types/node and it successfully installed, and TS picks it up. But using `require("fs")` is still `any`? The @types/node definitions deliberately type `require` as always returning `any`.
-
-
Show this thread
-
How am I supposed to import Node built-ins safely? I've googled "TypeScript with Node.js" and none of the guides cover this, or is it just meant to work and I'm doing something wrong?
Show this thread
End of conversation
New conversation -
-
-
Definitely agree about the Node typings part. What do you find lacking about the default tsconfig.json generated from the tsc --init command? Would you prefer not having to run that command and a blank tsconfig.json has those sane defaults?
-
Had no idea that command even existed. The tsconfig.json docs don't mention it at all. I've so far found the docs extremely confusing. I would rather not have a bunch of config options at all. From experience, their interactions aren't always necessarily stable.
- 1 more reply
New conversation -
-
-
Do you have to tell Flow which version of node you are targeting? Can’t see how it could work otherwise?
-
You don't. The type definitions for Node, as well as the DOM, and other built-ins are always targeting latest.
- 3 more replies
New conversation -
-
-
What specifically about TS replacing Babel do you find justifies additional config and setup?
- 1 more reply
New conversation -
-
-
As a recent reticent convert from Flow to TS, I'm very much enjoying your recent TypeShade rants.

-
Definitely true, TypeScript defaults !!SUCK!! as does lack of built in node type definitions - accidentally having two versions of them creates a world of hell, which yarn lock files make much worse. The ease of `yarn install @types/foo` though is epic relative to flow.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
he/him 