Do we need Babel to use arrow functions?


I'd like to use some node.js LTS native syntax like the arrow functions but WebStorm keeps returning "expression expected" error (like in this thread
Do we need to use Babel for that? I don't use Babel and arrow function are well supported in node.js 4.4.2 .



No. WebStorm doesn't need Babel to understand ES6 code, it uses its own parser for this. Please make sure to set 'JavaScript language version' in Preferences/Languages & Frameworks/JavaScript accordingly, to either 'ECMAScript 6' or 'JSX Harmony'.


Thanks for the quick reply.


Well I don't understand. Why when I check Preferences/Languages & Frameworks/JavaScript to "ECMAScript 6"

WebStorm shows the following message when I come back to the file ?

I probably missed something.


it's OK - WebStorm just offers you to set up a compiler for your ES6 file. If you don't need it, just click Dismiss - this won't affect code parsing in any way


Yes I dismissed it, and everything looks just fine. It's just a bit disturbing.


Thanks a lot for your help.


Please sign in to leave a comment.