Issue
Using the popular node-fetch library, Intellisense doesn't understand the return value of fetch().
Vim with coc:
Same thing in VSCode:
For most other libraries I have type completion, but this one does not work.
Things I tried
- Added
jsconfig.jsonandtsconfig.jsonfiles - Investigated the package, which exports a
@types/index.d.ts - Tried installing
@types/node-fetch, which also falls out-of-date often - Converted to
importsyntax, which works
Expected result
As I mentioned, changing to import syntax fixes the issue, but I want it to work with require too.
How can I have type completion on this library with CommonJS?




