Search code examples
node.jsintellij-ideapycharmwebstormjetbrains-ide

Multiple ECMA-Script versions in intellij idea


I'm using Intellij IDEA to develop a Node.js Application. I'm using es5 in the frontend and es6 in the backend.

Is there a way to define ECMAScript level per folder?

Thanks


Solution

  • On the new versions of the JetBrains IDES (iDea, WebStorm, and so on) you can configure different JavaScript language versions for different folders.

    For example, if you’re working on a JavaScript project that uses both ECMAScript 5.1 and newer ECMAScript version or JSX or Flow, you now have two options for how to configure it in WebStorm.

    To configure different JavaScript language versions for different folders, you need to go to Preferences | Languages and Frameworks | JavaScript menu and click the on button next to the drop-down with the version, then select a folder and the language version used for its files:

    enter image description here

    The version specified on the main settings page will be applied by default for all other JavaScript files in the project.

    Ref. WebStorm blog#multiple-js-versions