.eslintrc revision a32b84e499c14f3297801c4ae6c725908d19c976
{
"env": {
/**
* AMD is commented out as this will hide the error of forgetting to add a global directive
*/
// "amd": true,
"browser": true
},
"root": true,
"rules": {
/**
* Camel cased variable names.
*
* var apples_and_pears # bad
* var fruit {
* apple_and_pears: true
* }
*
* var applesAndPears # good
* var fruit {
* appleAndPears: true
* }
*/
"camelcase": [2, {
"properties": "always"
}],
/**
* 4 space indent.
*
* function() { # bad
* ··var apples
*
* function() { # good
* ····var apples
*/
"indent": [2, 4, {
/**
* One level indent on switch cases.
*
* switch(value) { # bad
* case "apples":
*
* switch(value) { # good
* ····case "apples":
*/
"SwitchCase": 1,
/**
* One level indent on variable declarations.
*
* var apples, { # bad
* pears
*
* var apples, { # good
* ····pears
*/
"VariableDeclarator": 1
}],
/**
* Maximum line length of 120 characters.
*/
"max-len": [2, 120, 4],
/**
* Multiple spaces not allowed.
*
* var fruit···=··"apples" # bad
*
* var fruit·=·"apples" # good
*/
"no-multi-spaces": 2,
/**
* Use of undeclared global variables not allowed.
*
* define([], function() { # bad
* apples = 10;
*
* *global define apples:true* # good
* define([], function() {
* apples = 10;
*/
"no-undef": 2,
/**
* Spaces inside of curly braces.
*
* {apples: true} # bad
*
* { apples: true } # good
*/
"object-curly-spacing": [2, "always"],
/**
* Require one variable declaration per scope. Required for JSLint compliance.
*
* var apples # bad
* var bananas
*
* var apples, # good
* bananas
*/
"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) { # bad
* }else{
*
* if (fruit) { # good. Space before else is not enforced but recommended
* } else {
*/
"space-after-keywords": [2, "always"],
/**
* Space required before opening block curly brace.
*
* if (fruit){ # bad
* function fruit(){}
*
* if (fruit) { # good
* function fruit() {}
*/
"space-before-blocks": [2, "always"],
/**
* Space required before function parenthesis.
*
* function() { # bad
*
* function () { # good
*/
"space-before-function-paren": [2, "always"],
/**
* Spaces not allowed in parentheses.
*
* fruit( "apple" ) # bad
*
* fruit("apple") # good
*/
"space-in-parens": [2, "never"],
/**
* Spaces required around infix operators
*
* var numOfApples = 1+2-3 # bad
*
* var numOfApples = 1 + 2 - 3 # good
*/
"space-infix-ops": [2, {
"int32Hint": false
}],
/**
* Space required after return, throw and case statements.
*
* return-1 # bad
*
* return -1 # good
*/
"space-return-throw-case": 2,
/**
* Validates that JSDoc is syntactically correct.
*/
"valid-jsdoc": [2, {
"prefer": {
/**
* Prefer using returns over return
*
* @return {int} The number of apples. # bad
*
* @returns {int} The number of apples. # good
*/
"return": "returns"
},
/**
* If there is no return statement, a @returns annotation is not required.
*/
"requireReturn": false
}]
// TODO: Add these additional rules once we have confidence in the current set being stable
/**
* comma-dangle
* no-debugger
* no-empty
* no-unreachable
* curly
* no-alert
* no-unused-vars
* 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)
*/
}
}