* AMD is commented out as this will hide the error of forgetting to add a global directive
* Camel cased variable names.
* var apples_and_pears # bad
* var applesAndPears # good
* One level indent on switch cases.
* One level indent on variable declarations.
* Maximum line length of 120 characters.
* Multiple spaces not allowed.
* var fruit···=··"apples" # bad
* var fruit·=·"apples" # good
* Use of undeclared global variables not allowed.
* define([], function() { # bad
* *global define apples:true* # good
* define([], function() {
* Spaces inside of curly braces.
* { apples: true } # good
"object-curly-spacing": [2, "always"],
* Require one variable declaration per scope. Required for JSLint compliance.
"one-var": [2, "always"],
* Double quotes for string literals. Single quotes allowed to avoid escaping
* var string = 'this is a string' # bad
* var string = "this is a string" # good
* var string = 'this is a "string"' # good
"quotes": [2, "double", "avoid-escape"],
* Space required after keywords.
* if (fruit) { # good. Space before else is not enforced but recommended
"space-after-keywords": [2, "always"],
* Space required before opening block curly brace.
"space-before-blocks": [2, "always"],
* Space required before function parenthesis.
"space-before-function-paren": [2, "always"],
* Spaces not allowed in parentheses.
"space-in-parens": [2, "never"],
* Spaces required around infix operators
* var numOfApples = 1+2-3 # bad
* var numOfApples = 1 + 2 - 3 # good
* Space required after return, throw and case statements.
"space-return-throw-case": 2,
* Validates that JSDoc is syntactically correct.
* Prefer using returns over return
* @return {int} The number of apples. # bad
* @returns {int} The number of apples. # good
* If there is no return statement, a @returns annotation is not required.
// TODO: Add these additional rules once we have confidence in the current set being stable
* array-bracket-spacing (no space)
* brace-style (else on the same line)
* comma-spacing "one, two"
* no-mixed-spaces-and-tabs
* no-multiple-empty-lines (max=2)