EDIT 9/15/2012
Looking further, I found that the javascript module has already been rewritten (really needed). Finally, you can find formatting options for javascript. It is available in netbeans nightly builds. Good luck to all.
http://bits.netbeans.org/download/trunk/nightly/
I released a fairly simple JS formatter that uses JSBeautify and works in Rhino.
http://plugins.netbeans.org/plugin/43263/jsbeautify
At this point, you should use an alternate key. I am working on changing the Javascript language in Netbeans to possibly release something better later (either as a plugin or as a patch). I am still familiar with what is going on at Netbeans.
For years, there has been talk of adding additional formatting options for Javascript to Netbeans. Nothing appeared. I am going to suggest that Javascript use JSBeautify (works in Rhino) to provide formatting, and not to introduce new features in Java. This simplifies the formatting process, plus the JSBeautify community is very large and actively developing.
source share