.eslintrc revision 870f52f65576c27949dfd1c332e8fd7457e5c48a
0N/A{
0N/A "root": true,
0N/A "extends": "eslint-config-forgerock",
0N/A "env": {
0N/A /**
0N/A * AMD is commented out as this will hide the error of forgetting to add a global directive
0N/A */
0N/A // "amd": true,
0N/A "browser": true
0N/A },
0N/A "rules": {
0N/A /*
0N/A * --------------------------------------------------------------------------------
0N/A * ERROR RULES
0N/A *
0N/A * These are rules we're sure about. They will cause the build to fail.
0N/A * --------------------------------------------------------------------------------
0N/A */
0N/A
0N/A /**
0N/A * Camel cased variable names.
0N/A *
0N/A * var apples_and_pears # bad
0N/A * var fruit {
0N/A * apple_and_pears: true
0N/A * }
0N/A *
0N/A * var applesAndPears # good
113N/A * var fruit {
113N/A * appleAndPears: true
113N/A * }
342N/A */
342N/A "camelcase": [2, {
113N/A "properties": "always"
113N/A }],
113N/A /**
113N/A * Require a capital letter for constructors.
113N/A *
113N/A * var f = Foo(); # bad
0N/A *
113N/A * var f = new Foo(); # good
113N/A */
113N/A "new-cap": [2, {
0N/A "capIsNew": false
113N/A }],
113N/A /**
113N/A * Multiple spaces not allowed.
113N/A *
113N/A * var fruit···=··"apples" # bad
113N/A *
113N/A * var fruit·=·"apples" # good
113N/A */
113N/A "no-multi-spaces": 2,
0N/A /**
113N/A * Space required after keywords.
113N/A *
113N/A * if(fruit) { # bad
113N/A * }else{
113N/A *
113N/A * if (fruit) { # good. Space before else is not enforced but recommended
113N/A * } else {
0N/A */
113N/A "space-after-keywords": [2, "always"],
113N/A /**
113N/A * Spaces not allowed in parentheses.
113N/A *
113N/A * fruit( "apple" ) # bad
113N/A *
113N/A * fruit("apple") # good
113N/A */
0N/A "space-in-parens": [2, "never"],
113N/A /**
113N/A * Spaces required around infix operators
113N/A *
113N/A * var numOfApples = 1+2-3 # bad
113N/A *
113N/A * var numOfApples = 1 + 2 - 3 # good
113N/A */
113N/A "space-infix-ops": [2, {
113N/A "int32Hint": false
113N/A }],
113N/A /**
113N/A * Space required before opening block curly brace.
113N/A *
113N/A * if (fruit){ # bad
0N/A * function fruit(){}
113N/A *
113N/A * if (fruit) { # good
113N/A * function fruit() {}
113N/A */
113N/A "space-before-blocks": [2, "always"],
113N/A
342N/A /**
0N/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
}],
/*
* --------------------------------------------------------------------------------
* WARNING RULES
*
* These are rules that we want to turn into errors but can't yet because there are
* too many violations. As we fix the violations, we will transition them into
* error rules.
* --------------------------------------------------------------------------------
*/
/**
* Maximum line length of 120 characters.
*/
"max-len": [1, 120, 4],
/**
* Spaces inside of curly braces.
*
* {apples: true} # bad
*
* { apples: true } # good
*/
"object-curly-spacing": [1, "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": [1, "double", "avoid-escape"],
/**
* Space required before function parenthesis.
*
* function() { # bad
*
* function () { # good
*/
"space-before-function-paren": [1, "always"],
/**
* Validates that JSDoc is syntactically correct.
*/
"valid-jsdoc": [1, {
"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
}]
/*
* --------------------------------------------------------------------------------
* DISABLED RULES
*
* These are rules we want to evaluate and promote to warnings.
* --------------------------------------------------------------------------------
*/
/**
* 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)
*/
}
}