set javascript level for a java project
I have an old java project (maven) and whenever I refactor js code IDEA has started adding ES2015/16 keywords like const. How do you set the javascript language level on a project so the code it generates remains compatible with IE?
Looked at the project structure dialog, but can only see Java language levels and no facet for js support?
Please sign in to leave a comment.
You can indicate JavaScript language version in Preferences | Languages&Frameworks | JavaScript.
Which one of those options is IE11? seem to be having a problem with const specifically? and there's no x-ua-compatible header
Try ECMAScript 5.1 (http://kangax.github.io/compat-table/es5/). In this case WebStorm won't suggest changing var to const.
ECMAScript 5.1 is what mine is set to and IntelliJ IDEA 2017 is inserting const not var when I extract variables for instance. I don't get a choice I'm having to replace const manually every time.
What Idea version do you use? While extracting a variable you should get a popup with the choice var/const.
Could you please provide a screencast?