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

1

8

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

Expend answered 7/12, 2015 at 5:45 Comment(0)
E
15

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

Expend answered 7/12, 2015 at 5:45 Comment(1)
Very good find on that language level. As of now, the latest ReSharper Early Access Program (EAP 4) looks to have support for the newest versions of TypeScript, all the way up to 2.0's early bits. Trying EAP 4 out now.Heidy

© 2022 - 2024 — McMap. All rights reserved.