Firstly it works only for pure JS projects ie projects that don’t have any .ts files.
You must have a package.json with the library dependency, coz that’s how TS knows that it needs to download the types for this library silently in the background
You can check the list of packages that support this feature using the list here:
Finally, if you want to see where the type declarations for these packages is stored, go here:
Lastly, you’ll have to use ES 6 style imports to have intellisense work.
Eg. To have lodash intellisense in your JS project, simply do:
- npm init
- create js file
- npm install –save lodash
- in the js file, write: import * as _ from ‘lodash’;
- Then when you do _. you’ll see intellisense working 🙂