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?

0
5 comments

You can indicate JavaScript language version in Preferences | Languages&Frameworks | JavaScript.

0

Which one of those options is IE11? seem to be having a problem with const specifically? and there's no x-ua-compatible header

0

Try ECMAScript 5.1 (http://kangax.github.io/compat-table/es5/). In this case WebStorm won't suggest changing var to const.

0

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.

0

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?

0

Please sign in to leave a comment.