Hi all,

We have been trying to configure and use the built-in Eclipse
formatter for JavaScript files but it doesn't work, it was built for
Java code. Although both languages have similar syntax, "JavaScript is
not Java" ;)

The state of the art formatter for JavaScript code is JSBeautifier
(http://jsbeautifier.org/) and we have found a plugin for Eclipse
(http://code.google.com/p/jsplugins/).

You just need to download the zip file (from the Downloads section in
the project) and extract its content in your Eclipse folder. Notice
that the contents needs to be extracted under the plugins folder.
Restart your Eclipse.

Now you'll find 2 new buttons for JSLint and JSBeautifier. Adjust the
preferences of the formatter under Window > Preferences >
JSBeautifier.
* 2 spaces for indentation
* Enable jslint scrict mode

Unfortunately it's not possible to perform automatic formatting on
save, so you'll need to it manually.

Happy JavaScript coding!

Best Regards,

PS. The JSLint plugin now available in your Eclipse uses a newer
version of the linter, more strict than the one we use so it's not
possible to configure it with our current coding standards.

-- 
Iván Perdomo

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Openbravo-development mailing list
Openbravo-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-development

Reply via email to