Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

False positive "Lexical declarations require ECMAScript 6" and "TypeScript 1.x feature. Current language is 1.4" error messages

After updating TypeScript to version 1.7 (the latest version at this time) I've been seeing Resharper point out errors, for example when using namespace, const and let, even though they should be supported by this version of TypeScript.

For example:

TypeScript 1.x feature. Current language is 1.4

Error 1

and

Lexical declarations (let and const) require ECMAScript 6 compiler target. Current target is ECMAScript 5.

Error 2

like image 535
Nic Avatar asked Dec 07 '15 05:12

Nic


1 Answers

It seems my version of Resharper (10.0.1) is unable to detect the TypeScript version.

To resolve this you can specify the version manually. Since this version of Resharper (the latest at this time of posting) doesn't support TypeScript 1.7, TypeScript 1.6 needs to be used.

Resharper options

like image 101
Nic Avatar answered Oct 24 '22 15:10

Nic