Didn't realize how difficult it was to get started with TypeScript compared to Flow. With Flow it has decent defaults so an empty `.flowconfig` is enough to get started. Having to install type definitions for Node in TS was another hurdle. In Flow they're built in.
-
-
import { readFile } from 'fs'
-
Ahhh TS forces you to use ES modules for CJS? I deliberately avoid it because interop standards aren't consistent. This feels like another potentially large breaking change that is going to hold TS back.
- 5 more replies
New conversation -
-
-
Any example projects on github that could help?
-
Unfortunately not. This is a private project that I'm converting.
End of conversation
New conversation -
-
-
Use `import fs = require("fs")` instead of var/const/let
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
You need to use `import` — require is the escape hatch for untyped modules. Also, for type definitions, check out TypeSynchttps://github.com/jeffijoe/typesync …
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
You can put it in the types array on the tsconfig
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
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 