Getting Visual Studio Code To Work With Next Versions of TypeScript
Recently whilst helping out a client with an Aurelia TypeScript project, I encountered a situation where the latest development version of TypeScript 2.0 was being used, but some of the newer features like filesGlob support were not being picked up. Module resolution and other things were also an issue.
Turns out you can configure Visual Studio Code to use a local version of TypeScript through a setting directive inside of a project settings file.
Firstly, make sure you have TypeScript installed in your project, I installed via
npm install typescript@next -D which saves it as a development dependency.
The best way to make sure this works in your project is to create a folder (if it doesn’t already exist) called
.vscode and inside there create a file (if it doesn’t already exist) called
settings.json and put the following inside of the curly braces:
This will then ensure that your Visual Studio Code editor uses your locally installed version of TypeScript opposed to an internal version of it which could be out of date.