Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why vscode is importing packages from typescript cache

I've started a react-native project generated using the cli. The app seems to be working just fine but i've notice that the import points to typescript cache instead of local node_modules. I'm not even using typescript.

IDE: vscode 1.19.3

import React, { Component } from 'react';

module "/Users/MyMac/Library/Caches/typescript/2.6/node_modules/@types/react/index"

like image 978
faxad Avatar asked Jan 27 '18 21:01

faxad


Video Answer


1 Answers

This is expected for JavaScript. These @types files power VS Code IntelliSense for npm modules such as react. The react module itself will still be imported from your local node_modules

See our documentation on Automatic type acquisition for more details

like image 125
Matt Bierner Avatar answered Oct 24 '22 06:10

Matt Bierner