False positive "Lexical declarations require ECMAScript 6" error message

Since upgrading to 10.0.1, I've started getting what I believe are invalid error messages from the Resharper TypeScript tools:

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

And Resharper has underlined every "let" and "const" in my TS code.


It's simply not true that these TS values require ES6 - they compile perfectly fine down to ES5 code, and have been since they were introduced into the language. This error didn't show up with 10.0.0, or with 9.x.

Any suggestions?

Comment actions Permalink

Hello Ken,

  Just got a response from the coleague https://youtrack.jetbrains.com/issue/RSRP-450971:
   We fail to detect TS version - the user should specify TS version manually in ReSharper options.
   Due to the fact that we don't support TS 1.7 currently - he should specify TS 1.6.


Comment actions Permalink

Thanks, Alexander. And yes, that works. But as I pointed out back on the other thread, I think there's a more intelligent way of handling this. If you see that the TS version is higher than you support, RS should default to the highest version that you do support, not what is (apparently?) the lowest.


Please sign in to leave a comment.