Recommended JavaScript Style Guides & Beautifiers

For developers interested in improving the code style consistency of the JavaScript they write, I'm happy to recommend the following style guides:

1. Idiomatic.js (highly recommended, very comprehensive and includes contributions by +Rick Waldron , +Mathias Bynens and more)

2. jQuery Core Style Guide (used by jQuery core, QUnit and many other projects)

3. Google JavaScript Style Guide - with some further comments

4. Dojo Style Guide (another very comprehensive alternative)

5. Aloha Editor JavaScript Style Guide (recommends jQuery style guide, but has some useful additions)

* I've reviewed all of the above and discarded other guides that were either entirely too brief/vague or not that useful at all (e.g the GitHub JS style guide).


Whilst maintaining consistent style while writing your code is extremely important, it can also be useful to use a formatter or beautifier to enforce style rules for you.

The first tool I recommend playing with is called CodePainter ( This is a JavaScript beautifier that can infer coding style from a sample you provide it (so rather than giving it a complete style guide, give it a sample with the rules already enforced and it can do the rest).

I can also recommend, which most people are already aware of. One of the nice things about it is that you can plug it into your favorite code editor (e.g SublimeText, use it in a Chrome extension or in a bunch or other ways.

Hope these are useful!
Shared publiclyView activity