Raindrop/CodeStyle

From MozillaWiki
< Raindrop
Revision as of 23:10, 8 January 2010 by Jrburke (talk | contribs) (Created page with '== Code Style == Here are some style guidance for the Raindrop code. === JavaScript === All code should conform to the [http://www.jslint.com/lint.html JSLint] style. Big high…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Code Style

Here are some style guidance for the Raindrop code.

JavaScript

All code should conform to the JSLint style. Big highlights:

  • 4 spaces for indentation, using spaces, not tabs.
  • One var call per function.
  • Always use braces around blocks.

To validate your code, here are some options:

  • Use the online website
  • If using Komodo or Komodo Edit, there is JSLint add-on. Go to Tools, Add-Ons, then click the Get Add-ons button, and search for "jslint".
  • Use the dvcs_jslint to hook up JSLint as a pre-commit step for Mercurial.

All documentation for the JavaScript should be done in JSDoc format.