How to add ES6?

How to add ES6 to VSC ?

Is there a way to find what version your IDE has onboard? You may already have ES6 support. If your installation is newer than 2015 much of the support is there. If it is newer than say, 2018 you can pretty much be certain that most or all of the latest ES is supported. If you have an old installation, then go to the vendor’s site and look for the newest stable release and find out how to upgrade yours (or uninstall/reinstall).

If you’re using an up-to-date version of Visual Studio Code, it should have no issue with your use of ES6 features.

Here’s a rudimentary example using let, which didn’t exist before ES6.


What does this mean, I mean beyond the obvious.
Is it something to consider fixing or upgrading ?

Check the Help menu of VSC to see what version you have. It says the initial release was in 2015, which should have coincided the release ES2015, but it may have been released earlier. The stable current release is version 1.44 and was just released last week. If you have an early version then it might a good idea to replace it or upgrade, if that is possible.

Since VSC is not an IDE, you need Node.js to run ES from the command line. How old is your installation of jshint? That program goes back nine years, four years before ES2015, and five before ES6. Might be an idea to install the newest version (2019).

npm install -g jshint

I do have the most current version of VSC and I am able to use the ‘let’ variable.
Guess the problem is with jshint. think I will ditch that and stick with ESLint.
ESLint generated no errors or messages about ES6.

1 Like

And yes, I do have Node installed and I pass the .js file I want to run to the Node runtime.

I think that is the same command I ran.
And it still threw those ES6 errors / messages.

I could see you have Node.js. If ESLint works properly, then don’t bother with JSLint.

1 Like