Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 97660

Missing intellisense when importing .ts file in .js file

$
0
0

I try to use tsx to run a NodeJS application made of JavaScript and Typescript modules. The JavaScript modules are ESM, not CommonJS. For example I have these files:

// provider.tsexport funcA(p: unknown): unknown {...}// consumer.jsimport * as provider from "./provider.ts"provider.funcA("foo");

It runs very well with tsx. VSCode's intellisense works well in TS file but it doesn't in JS file. When I hover provider it shows import provider and I have no completion whatsoever.Here is my tsconfig.json:

{"compilerOptions": {"module": "NodeNext","target": "ESNext","allowJs": true,"strict": true,  },"include": [<the directory containing both JS and TS files>  ],}

How can I make Intellisense work in VSCode for TS imports in my JS files?


Viewing all articles
Browse latest Browse all 97660


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>