What IDE's can be configured to auto-format JavaScript according to Google's JavaScript Style Guide?

1.7k Views Asked by At

I'm trying to conform my code to Google's JavaScript Style Guide but some of the requirements require very granular control that I haven’t been able to achieve in Eclipse, IntelliJ, etc. For instance, within block comments the @fileoverview description should wrap at 80 columns but not indent, while the @param description should wrap but indent 4 spaces. Just curious if there are IDE’s that let you run a format command to conform with Google’s standards. The closest I've come is Eclipse for JavaScript developers.

2

There are 2 best solutions below

0
On

I'm using Visual Studio 2010 code reformatting feature (ctrl k + d) and these code snippets:

Annotated, Google Closure Javascript Compiler - Visual Studio Snippets

Free version of Visual Studio is here http://www.microsoft.com/express/Web/

1
On

I am using IntelliJ 10.5 and check my coding style via closure-linter and everything works fine. Sometimes I still have to intervene so that the linebreaks make more sense.

Greetings,

Jan