You need the latest version.
Specifically, you need TypeScript@>=2.3
For project level installation (recommended)
npm install --dev typescript@latest
If you use tsc
via the global command line
npm install --global typescript@latest
To override the version used by VS Code to use your global installation
Open user settings
Change it as follows (replace my name with yours)
// Place your settings in this file to overwrite the default settings
{
"typescript.tsdk": "C:/Users/Aluan/AppData/Roaming/npm/node_modules/typescript/lib",
//..
If you are running Linux or OSX the path will be something like
"~/npm/node_modules/typescript/lib"
That said, the latest VS Code should ship with TypesScript@>3 so you shouldn't need to do anything except update it...
Other package managers:
JSPM:
command line:
jspm install --dev typescript@latest
VS Code project level settings:
{
"typescript.tsdk": "./jspm_packages/npm/typescript@latest/lib"
}
Yarn:
command line:
yarn add --dev typescript@latest
VS Code project level settings:
{
"typescript.tsdk": "./node_modules/typescript/lib"
}
tsconfig.json
file. – cartant"strict"
flag is fully supported intsconfig.json
, I've been using it for weeks. – Aluan Haddad