Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure ES6 code inspection

I've been using PyCharm and really liked it. Recently I switched to ES6 for my javascript code. But PyCharm doesn't seem to like it. For things like => or let it will report syntax error. I tried a lot of things like turning off all inspection and all my effort were in vain. I think I must be missing something silly because normally PyCharm is quite intelligent. What's the trick?

PyCharm version: 2016.1

END OF QUESTION

A bit of rant in the end: I'd really like to get this working. As a long time Vim user, I find it hard to configure Vim for dynamic language such as Javascript and keep making silly mistakes that's time consuming. I've tried VSCode and like the default behaviour but the Vim emulation is sh*t. JetBrain products has the best Vim emulation ever and to me that's a big selling point.

like image 540
lang2 Avatar asked May 23 '16 03:05

lang2


People also ask

How do I run ES6 browser?

Safari, Chrome, Firefox and Edge all support the ES6 Modules import syntax. Here's what they look like. Simply add type="module" to your script tags and the browser will load them as ES Modules. The browser will follow all import paths, downloading and executing each module only once.


1 Answers

Just go to Preferences -> Languages & Frameworks -> Javascript and change "JavaScript language version" to ECMAScript 6

enter image description here

like image 199
Diogo Martins Avatar answered Oct 18 '22 06:10

Diogo Martins