.eslintrc revision b1d9fd8dc3197f92d1b490d07e13f138149234d0
2471N/A{
2471N/A "env": {
2471N/A /**
2471N/A * AMD is commented out as this will hide the error of forgetting to add a global directive
2471N/A */
2471N/A // "amd": true,
2471N/A "browser": true
2471N/A },
2471N/A "root": true,
2471N/A "rules": {
2471N/A /**
2471N/A * Camel cased variable names.
2471N/A *
2471N/A * var apples_and_pears # bad
2471N/A * var fruit {
2471N/A * apple_and_pears: true
2471N/A * }
2471N/A *
2471N/A * var applesAndPears # good
2471N/A * var fruit {
2471N/A * appleAndPears: true
2471N/A * }
2471N/A */
2471N/A "camelcase": [2, {
2471N/A "properties": "always"
2471N/A }],
2471N/A /**
2471N/A * Use === and not ==. Required for JSLint compliance.
2471N/A */
2471N/A "eqeqeq": [2, "smart"],
2976N/A /**
2471N/A * 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
}],
/**
* Semicolons must be used any place where they are valid.
*
* var name = "ESLint" # bad
*
* var name = "ESLint"; # good
*/
"semi": 2
// 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)
*/
}
}