[aerogear-dev] JavaScript formatter

Kris Borchers kris at redhat.com
Tue Oct 29 08:02:18 EDT 2013


A couple of options the jQuery project has been looking at but still hasn't decided on are node-jscs https://github.com/mdevils/node-jscs and esformatter https://github.com/millermedeiros/esformatter. Neither of them are perfect and neither are grunt plugins (probably not too hard to make them work with grunt) but they get close.

On Oct 29, 2013, at 6:53 AM, Lucas Holmquist <lholmqui at redhat.com> wrote:

> 
> On Oct 29, 2013, at 7:14 AM, Matthias Wessendorf <matzew at apache.org> wrote:
> 
>> 
>> 
>> 
>> On Tue, Oct 29, 2013 at 12:08 PM, Erik Jan de Wit <edewit at redhat.com> wrote:
>>>  
>>> Talking with qmx and lholmquist about this it seems that JS land doesn't have good tools for this. 
>>> 
>>> 
>>> hrm - the grunt worked for me; but I don't know if it is _that_ good
> 
> grunt will run jshint, which doesn't do the formatting for you,  but tells you what you need to fix.  but until up to a point.  
> 
> I think there is a difference between formatting and whitespace
> 
> 
>> 
>> The formatter that is available with grunt seems to have very little settings [1], but if that is fine for most of us by all means we should use it!
>> 
>> [1] https://npmjs.org/package/grunt-jsbeautifier
>> 
>> perhaps here we could help/improve ? 
> 
> +1 to this option
> 
>>  
>> 
>>>  
>>> 
>>> To have something in the mean time we could use something like the eclipse formatter, because it can format JS has a ton of options and there are already a lot of external tools that use it:
>>> 
>>> https://github.com/krasa/EclipseCodeFormatter
>>> 
>>> I doubt that a JS weenie will use Eclipse/IDEA
>> 
> Correct,  none of us "Rock Stars" would use an IDE :)
> 
> 
>> It's meant as an example you don't need the full eclipse IDE to use the formatting tool. It can be used standalone and it has a ton of options about where to put whitespace. We could also build our own javascript code formatter, but why not have something that works today. And I think even a javascript coder can execute a command line utility.
> 
> if there is a java dependency then it is a no go for JS land
> 
>> 
>> Just trying to be pragmatic 
>> 
>> 
>> 
>> _______________________________________________
>> aerogear-dev mailing list
>> aerogear-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>> 
>> 
>> 
>> -- 
>> Matthias Wessendorf 
>> 
>> blog: http://matthiaswessendorf.wordpress.com/
>> sessions: http://www.slideshare.net/mwessendorf
>> twitter: http://twitter.com/mwessendorf
>> _______________________________________________
>> aerogear-dev mailing list
>> aerogear-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/aerogear-dev
> 
> _______________________________________________
> aerogear-dev mailing list
> aerogear-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/aerogear-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-dev/attachments/20131029/9b1fb04e/attachment.html 


More information about the aerogear-dev mailing list