Skip to content
Ankit Ahuja edited this page Jun 17, 2013 · 1 revision

Indentation

2 Spaces, Soft Tabs.

Comments

JSDoc comments, use /* */. Example:

/**
 * Retrieves all the global rules
 * @return {Object} The rules of the global stylesheet.
 */

Use // for inline comments and comments that are only a few lines long.

Blank Lines

Linkes should have no trailing spaces. In Sublime Text, set trim_trailing_white_space_on_save to true in preferences. In TextMate, use this bundle.

Line Length Limit

There is no hard set limit for this. Just make sure it is readable.

JSDoc Documentation

Visit the official jsdoc-toolkit reference for a detailed list of all the tags used in our JSDoc documentation.

Everything else

For everything else, follow the rules in the Google JavaScript Style Guide: http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml

Clone this wiki locally