Site Overlay

How to use TypeScript 3.8 with Visual Studio Code?

Share : Answer for How to use TypeScript 3.8 with Visual Studio Code?

Since VS Code ships with a stable version of TypeScript by default, you need either to change the TypeScript version used with VS Code from the user settings or the workspace settings or you can also download the latest VS Code 1.43 version which ships with TypeScript 3.8.3 by default.

 

These are the steps required to update your typescript version in VS Code:

  1. First, you need to install the desired TypeScript version either globally or locally, e.g npm install -g typescript@3.8.3
  2. Next, head over to VS Code User Settings ( Using F1 > Open User Settings)
  3. Next, change or add "typescript.tsdk": "{npm_path}/typescript/lib". Change npm_path with your actual npm path either the global or the local one ( "./node_modules/typescript/lib") depending on if you want to upgrade typescript globally or locally in a project.

 

You can also use the workspace settings via F1 > Open Workspace Settings

After configuring  the typescript.tsdk setting you need to use the UI to choose the preferred version:

Simply. proceed by clicking on the version displayed in the footer of your IDE, next select the version from the dropdown menu.