-
Notifications
You must be signed in to change notification settings - Fork 34.7k
Description
I recently went through the process of writing a new node module and I gave it a try using TypeScript. Even though I am a developer on VSCode I had to leave Code to search for a solution how to get Intellisense to work for the built in node modules.
Steps:
- create a fresh folder
- add a simple
package.json
- add a simple
index.ts
file (see contents below) - notice an error around the import
- find no advice how to fix it
The actual fix was to add @types/node
as a dependency but we should offer this to the user when we detect that a built in node module is being used. It is especially weird because we seem to offer this for other 3rd party modules that you add later on.
index.ts
var fs = require("fs");
I am tempted to mark this "important" because I think a lot of users will stop trying TypeScript after they went as far as I did without searching for the solution. And I think node.js with TypeScript users are one of our main target audience.
It could well be that this issue has to move to the TypeScript repo, but I start here.