When using TypeScript, it becomes necessary to manually handle types packages as they are essential for the TypeScript compile process, treating them as real dependencies.
On the other hand, when it comes to JavaScript, types are often utilized to enhance IntelliSense capabilities. Tools like VS Code can determine which types packages to download based on the code's import
statements and require
calls through automatic type acquisition. This feature eliminates the need for manual installation and ensures that your local node_modules directory remains unaltered.
If automatic type acquisition fails to work properly, installing types manually is always an option.
For further information, refer to the VS Code JS IntelliSense documentation.