As the error message says, add lib: es2015
to your tsconfig.json
// tsconfig.json
{
"compilerOptions": {
"lib": [ "es2015" ]
}
}
UPDATE: if this doesn’t work for you, try this:
JetBrains IDE such as WebStorm, use its own implementation by default. Make sure you configure it to use TypeScript language service instead.
For Visual Studio, the project files and tsconfig.json
are mutually exclusive. You will need to configure your project directly.
https://github.com/Microsoft/TypeScript/issues/3983#issuecomment-123861491