You need a package.json or import statements in your JavaScript file for automatic acquisition. They mention it in the docs section you included.
Type declaration files are automatically downloaded and managed by Visual Studio Code for packages listed in your project's package.json or that you import into a JavaScript file.
So, if you are just including a library like GSAP in a script tag in your HTML, you don't get intellisense automatically. This is more likely to the case in front-end code. In a backend project, you probably have a package.json with dependencies, so you probably wouldn't encounter this!
I will add this to the article to give a complete explanation.
I have to say I didn't get the distinction because I almost always reach for additional tools (ESLint, Prettier, Babel, some bundler like Parcel or Rollup) as soon as the project reaches a size where I also need a third-party library.
It kinda sucks for beginners who wouldn't be using NPM automatically. I often go without NPM for creative coding and small projects. It's not a great situation to be bound so tightly to the additional tools!
I updated the article with that distinction. Thanks for the feedback.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
🤔 I thought VSCode automatically downloaded them for you: code.visualstudio.com/docs/nodejs/...
Hi Thomas,
You need a
package.json
or import statements in your JavaScript file for automatic acquisition. They mention it in the docs section you included.So, if you are just including a library like GSAP in a script tag in your HTML, you don't get intellisense automatically. This is more likely to the case in front-end code. In a backend project, you probably have a
package.json
with dependencies, so you probably wouldn't encounter this!I will add this to the article to give a complete explanation.
Thanks for the precision.
I have to say I didn't get the distinction because I almost always reach for additional tools (ESLint, Prettier, Babel, some bundler like Parcel or Rollup) as soon as the project reaches a size where I also need a third-party library.
Yes, that's why you never encountered it!
It kinda sucks for beginners who wouldn't be using NPM automatically. I often go without NPM for creative coding and small projects. It's not a great situation to be bound so tightly to the additional tools!
I updated the article with that distinction. Thanks for the feedback.