velo / maven-formatter-plugin

Maven2 Java Formatter Plugin - Exported from code.google.com/p/maven-java-formatter-plugin
Other
11 stars 7 forks source link

JavaScript ES6 Support #31

Open RoHePu opened 7 years ago

RoHePu commented 7 years ago

Hi, in our Web-Project we use maven-formatter-plugin as formatter for our JavaScript Files. Unfortunately the support for ES6 patterns seems to be very poor. Trying to format a ES6 class leads to an exception of the formatter. Is there a way to make the formatter understanding ES6 patterns?

Thanks & Best Robin

velo commented 7 years ago

Well, I'm using whatever eclipse jsdt uses.

I assume it doesn't support es6

RoHePu commented 7 years ago

Hey @velo , thanks for your fast reply. Yes it seems that jsdt does not understand ES6 patterns. Even when I try to format a *.js file with some code like

v => ({ even: v, odd: v + 1 })

the formatting of the file fails. Thus the jsdt formatter seems to don't understand ES6. Unless the website claims that ES6 is supported

ECMAScript 2015 (ES6) parser

See here

I think I will close the issue. There won't be a fix in the nearer future.

Thanks and Best Robin

velo commented 7 years ago

Let's leave it open, eventually someone may come with a solution for this

velo commented 7 years ago

Seems it's already out there.... just need to figure out what version or settings is necessary to enable it

https://bugs.eclipse.org/bugs/show_bug.cgi?id=481706

https://www.eclipse.org/community/eclipse_newsletter/2016/may/article2.php