Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PhpStorm "Let definition are not supported by current JavaScript version"

I am trying to be a good little programmer and use the new tools available for coding JavaScript. Therefore I'm trying to use let instead of var to isolate variables.

This works fine in my browser however PhpStorm sees it as an error and when I hover above it gives me:

Let definition are not supported by current JavaScript version

So my question is how do I upgrade the current JavaScript version?

like image 526
Marc Rasmussen Avatar asked Mar 03 '16 12:03

Marc Rasmussen


2 Answers

Go to

Settings / Languages & Frameworks / JavaScript

(it may be Preferences / Languages & Frameworks / JavaScript on some OSes)

...and set the "JavaScript language version" to "ECMAScript 6" (or, if they've updated to reflect current naming, "ECMAScript 2015" — or "ECMAScript 2016" or later if you're coding to a newer spec):

enter image description here

like image 174
baao Avatar answered Nov 11 '22 10:11

baao


The setting is found in File -> Settings -> Language & Frameworks -> Javascript and the option should be on the left, a dropdown box next to "JavaScript Language Version"

like image 9
Gareth Parker Avatar answered Nov 11 '22 10:11

Gareth Parker