Unable to get intellisense to work for .ts files.
test.js
var http = require('http');
http.[intellisense available]
test.ts
var http = require('http');
http.[no suggestions]
Does not appear to be reading index.d.ts
Here is tsconfig.json:
{
"compileOnSave": true,
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"sourceMap": true,
"watch": true
}
}
Any suggestions. Really want to use typescript, but need the hints while learning node. Prefer not to use javascript.
Thanks.
Learning curve.
For a .js file:
var http = require('http');
for a .ts file:
import http = require('http');
The transpiler will write out: var http = ...
The "import" instead of "var" gets intellisense to work. Right clicking for "go to definition" works.
Problem solved.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With