I'd look at disabling VS Code's automatic type acquisition feature for your workspace (or for your user). To disable for your workspace, edit your workspace's .vscode/settings.json
. To disable for your user, edit your user settings.json (use the Preferences: Open User Settings (JSON)
command in the command palette).
The specific setting value is:
"typescript.disableAutomaticTypeAcquisition": true,
That setting's description says:
Disables automatic type acquisition. Automatic type acquisition fetches @types
packages from npm to improve IntelliSense for external libraries.
That link it links to says this:
IntelliSense for JavaScript libraries and frameworks is powered by TypeScript type declaration (typings) files. Type declaration files are written in TypeScript so they can express the data types of parameters and functions, allowing VS Code to provide a rich IntelliSense experience in a performant manner.
Many popular libraries ship with typings files so you get IntelliSense for them automatically. For libraries that do not include typings, VS Code's Automatic Type Acquisition
will automatically install community maintained typings file for you.
Automatic type acquisition requires npmjs, the Node.js package manager, which is included with the Node.js runtime.
core-js
is one such package that does not come with its own type declaration files (at least- at the time of this writing). You can tell by the blue-outlined icon on its npm page that has the letters "DT" in it, which stands for "Definitely Types", which is the name of the TypeScript community project that maintains type definition files for JavaScript libraries and other projects that do not provide their own.
If you still want type declarations for IntelliSense for specific package dependencies you use, just explicitly specify the @types/<package-name>
dependencies in your devDependencies
field in your package.json file for those specific package dependencies.