Visual Studio Code underlines require and module keywords in my .js
files which I run with Node. How to prevent this from happening?
Since Visual studio code is written in TypeScript you need to download type definitions for nodejs. To do this click on the text (require/ module) which is underlined. Now it would show a yellow bulb.
Now click on that yellow bulb. A menu should open , select Download type definition for node.d.ts
. Done visual studio code will download the type files for you.
Now a typings
folder will display in your project folder , remember to add that in your .gitignore
file to avoid unnecessary file commit to your git repo
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.