ES6 syntax is not recognized when using '.es' extension

Hi,

In PHPStorm, I have set the JavaScript language version to be ECMAScript 6. I also went into file types and added .es as a Javascript file type. I would expect to be able to write ES6 syntax JavaScript in files ending with .es but PHPStorm is not recognizing it and showing errors. It does work correctly when I use a .js or .jsx extension, but my project will only transpile es6 features in files with a .es extension. Is there any other setting I need to change?

Thank you,
-Rob

3 comments
Comment actions Permalink

Please can you attach a screenshot of your file types settings and error screenshot?

0
Comment actions Permalink

I have attached 4 screen shots.

1) My JavaScript language settings (set to ECMAScript 6)
2) My JavaScript file types (set to include *.es)
3) A screenshot of 'test.es', which shows syntax errors for valid ECMAScript 6 code
4) A screenshot of 'test.js', which is exactly the same as 'test.es', but show no syntax errors



Attachment(s):
Screen Shot 2015-03-22 at 12.15.17 PM.png
Screen Shot 2015-03-22 at 12.14.53 PM.png
Screen Shot 2015-03-22 at 12.14.47 PM.png
Screen Shot 2015-03-22 at 12.14.35 PM.png
0
Comment actions Permalink

Thanks, reproduced. The problem is that *.es extension is hardcoded as ActionScript file extension. Logged as https://youtrack.jetbrains.com/issue/WEB-15841, please follow it for updates.
For now I can suggest trying a different extension, .es6, for example

0

Please sign in to leave a comment.