treeherder/.eslintrc

67 строки
1.8 KiB
Plaintext
Исходник Обычный вид История

{
"root": true,
"env": {
"browser": true
},
"extends": "eslint:recommended",
"rules": {
// Default rules we've disabled until the failures are fixed.
// Remove a line to enable the rule.
"comma-dangle": 0,
"no-console": 0,
"no-redeclare": 0,
"no-undef": 0,
"no-unused-vars": 0,
// Non-default rules we've chosen to enable.
Bug 1222718 - Enable non-default eslint rules that already pass The following rules are already passing, without any code changes on our side. I've reduced the list down to just the rules that I think we want to enforce. The fact that we currently pass them means that these rules generally aren't too contentious, however I'm happy to adjust as needed, either now or when we first hit failures in them. accessor-pairs: Enforces getter/setter pairs in objects http://eslint.org/docs/rules/accessor-pairs comma-style: enforce one true comma style http://eslint.org/docs/rules/comma-style eol-last: enforce newline at the end of file, with no multiple empty lines http://eslint.org/docs/rules/eol-last guard-for-in: make sure for-in loops have an if statement http://eslint.org/docs/rules/guard-for-in linebreak-style: disallow mixed 'LF' and 'CRLF' as linebreaks http://eslint.org/docs/rules/linebreak-style new-cap: require a capital letter for constructors http://eslint.org/docs/rules/new-cap new-parens: disallow the omission of parentheses when invoking a constructor with no arguments http://eslint.org/docs/rules/new-parens no-array-constructor: disallow use of the Array constructor http://eslint.org/docs/rules/no-array-constructor no-bitwise: disallow use of bitwise operators http://eslint.org/docs/rules/no-bitwise no-caller: disallow use of arguments.caller or arguments.callee http://eslint.org/docs/rules/no-caller no-div-regex: disallow division operators explicitly at beginning of regular expression http://eslint.org/docs/rules/no-div-regex no-empty-label: disallow use of labels for anything other than loops and switches http://eslint.org/docs/rules/no-empty-label no-empty-pattern: disallow use of empty destructuring patterns http://eslint.org/docs/rules/no-empty-pattern no-eval: disallow use of eval() http://eslint.org/docs/rules/no-eval no-extend-native: disallow adding to native types http://eslint.org/docs/rules/no-extend-native no-extra-bind: disallow unnecessary function binding http://eslint.org/docs/rules/no-extra-bind no-floating-decimal: disallow the use of leading or trailing decimal points in numeric literals http://eslint.org/docs/rules/no-floating-decimal no-implied-eval: disallow use of eval()-like methods http://eslint.org/docs/rules/no-implied-eval no-iterator: disallow usage of __iterator__ property http://eslint.org/docs/rules/no-iterator no-label-var: disallow labels that share a name with a variable http://eslint.org/docs/rules/no-label-var no-labels: disallow use of labeled statements http://eslint.org/docs/rules/no-labels no-lone-blocks: disallow unnecessary nested blocks http://eslint.org/docs/rules/no-lone-blocks no-multi-str: disallow use of multiline strings http://eslint.org/docs/rules/no-multi-str no-native-reassign: disallow reassignments of native objects http://eslint.org/docs/rules/no-native-reassign no-new: disallow use of the new operator when not part of an assignment or comparison http://eslint.org/docs/rules/no-new no-new-func: disallow use of new operator for Function object http://eslint.org/docs/rules/no-new-func no-new-object: disallow the use of the Object constructor http://eslint.org/docs/rules/no-new-object no-new-wrappers: disallows creating new instances of String,Number, and Boolean http://eslint.org/docs/rules/no-new-wrappers no-octal-escape: disallow use of octal escape sequences in string literals, such as var foo = "Copyright \251"; http://eslint.org/docs/rules/no-octal-escape no-proto: disallow usage of __proto__ property http://eslint.org/docs/rules/no-proto no-return-assign: disallow use of assignment in return statement http://eslint.org/docs/rules/no-return-assign no-script-url: disallow use of javascript: urls. http://eslint.org/docs/rules/no-script-url no-self-compare: disallow comparisons where both sides are exactly the same http://eslint.org/docs/rules/no-self-compare no-sequences: disallow use of the comma operator http://eslint.org/docs/rules/no-sequences no-shadow-restricted-names: disallow shadowing of names such as arguments http://eslint.org/docs/rules/no-shadow-restricted-names no-spaced-func: disallow space between function identifier and application http://eslint.org/docs/rules/no-spaced-func no-trailing-spaces: disallow trailing whitespace at the end of lines http://eslint.org/docs/rules/no-trailing-spaces no-undef-init: disallow use of undefined when initializing variables http://eslint.org/docs/rules/no-undef-init no-unexpected-multiline: Avoid code that looks like two expressions but is actually one http://eslint.org/docs/rules/no-unexpected-multiline no-unused-expressions: disallow usage of expressions in statement position http://eslint.org/docs/rules/no-unused-expressions no-useless-call: disallow unnecessary .call() and .apply() http://eslint.org/docs/rules/no-useless-call no-void: disallow use of the void operator http://eslint.org/docs/rules/no-void no-with: disallow use of the with statement http://eslint.org/docs/rules/no-with semi: require or disallow use of semicolons instead of ASI http://eslint.org/docs/rules/semi space-return-throw-case: require a space after return, throw, and case http://eslint.org/docs/rules/space-return-throw-case strict: controls location of Use Strict Directives http://eslint.org/docs/rules/strict yoda: require or disallow Yoda conditions http://eslint.org/docs/rules/yoda
2015-11-06 02:22:17 +03:00
"accessor-pairs": 2,
"comma-style": 2,
"eol-last": 2,
"guard-for-in": 2,
"indent": [2, 4, {"SwitchCase": 1}],
Bug 1222718 - Enable non-default eslint rules that already pass The following rules are already passing, without any code changes on our side. I've reduced the list down to just the rules that I think we want to enforce. The fact that we currently pass them means that these rules generally aren't too contentious, however I'm happy to adjust as needed, either now or when we first hit failures in them. accessor-pairs: Enforces getter/setter pairs in objects http://eslint.org/docs/rules/accessor-pairs comma-style: enforce one true comma style http://eslint.org/docs/rules/comma-style eol-last: enforce newline at the end of file, with no multiple empty lines http://eslint.org/docs/rules/eol-last guard-for-in: make sure for-in loops have an if statement http://eslint.org/docs/rules/guard-for-in linebreak-style: disallow mixed 'LF' and 'CRLF' as linebreaks http://eslint.org/docs/rules/linebreak-style new-cap: require a capital letter for constructors http://eslint.org/docs/rules/new-cap new-parens: disallow the omission of parentheses when invoking a constructor with no arguments http://eslint.org/docs/rules/new-parens no-array-constructor: disallow use of the Array constructor http://eslint.org/docs/rules/no-array-constructor no-bitwise: disallow use of bitwise operators http://eslint.org/docs/rules/no-bitwise no-caller: disallow use of arguments.caller or arguments.callee http://eslint.org/docs/rules/no-caller no-div-regex: disallow division operators explicitly at beginning of regular expression http://eslint.org/docs/rules/no-div-regex no-empty-label: disallow use of labels for anything other than loops and switches http://eslint.org/docs/rules/no-empty-label no-empty-pattern: disallow use of empty destructuring patterns http://eslint.org/docs/rules/no-empty-pattern no-eval: disallow use of eval() http://eslint.org/docs/rules/no-eval no-extend-native: disallow adding to native types http://eslint.org/docs/rules/no-extend-native no-extra-bind: disallow unnecessary function binding http://eslint.org/docs/rules/no-extra-bind no-floating-decimal: disallow the use of leading or trailing decimal points in numeric literals http://eslint.org/docs/rules/no-floating-decimal no-implied-eval: disallow use of eval()-like methods http://eslint.org/docs/rules/no-implied-eval no-iterator: disallow usage of __iterator__ property http://eslint.org/docs/rules/no-iterator no-label-var: disallow labels that share a name with a variable http://eslint.org/docs/rules/no-label-var no-labels: disallow use of labeled statements http://eslint.org/docs/rules/no-labels no-lone-blocks: disallow unnecessary nested blocks http://eslint.org/docs/rules/no-lone-blocks no-multi-str: disallow use of multiline strings http://eslint.org/docs/rules/no-multi-str no-native-reassign: disallow reassignments of native objects http://eslint.org/docs/rules/no-native-reassign no-new: disallow use of the new operator when not part of an assignment or comparison http://eslint.org/docs/rules/no-new no-new-func: disallow use of new operator for Function object http://eslint.org/docs/rules/no-new-func no-new-object: disallow the use of the Object constructor http://eslint.org/docs/rules/no-new-object no-new-wrappers: disallows creating new instances of String,Number, and Boolean http://eslint.org/docs/rules/no-new-wrappers no-octal-escape: disallow use of octal escape sequences in string literals, such as var foo = "Copyright \251"; http://eslint.org/docs/rules/no-octal-escape no-proto: disallow usage of __proto__ property http://eslint.org/docs/rules/no-proto no-return-assign: disallow use of assignment in return statement http://eslint.org/docs/rules/no-return-assign no-script-url: disallow use of javascript: urls. http://eslint.org/docs/rules/no-script-url no-self-compare: disallow comparisons where both sides are exactly the same http://eslint.org/docs/rules/no-self-compare no-sequences: disallow use of the comma operator http://eslint.org/docs/rules/no-sequences no-shadow-restricted-names: disallow shadowing of names such as arguments http://eslint.org/docs/rules/no-shadow-restricted-names no-spaced-func: disallow space between function identifier and application http://eslint.org/docs/rules/no-spaced-func no-trailing-spaces: disallow trailing whitespace at the end of lines http://eslint.org/docs/rules/no-trailing-spaces no-undef-init: disallow use of undefined when initializing variables http://eslint.org/docs/rules/no-undef-init no-unexpected-multiline: Avoid code that looks like two expressions but is actually one http://eslint.org/docs/rules/no-unexpected-multiline no-unused-expressions: disallow usage of expressions in statement position http://eslint.org/docs/rules/no-unused-expressions no-useless-call: disallow unnecessary .call() and .apply() http://eslint.org/docs/rules/no-useless-call no-void: disallow use of the void operator http://eslint.org/docs/rules/no-void no-with: disallow use of the with statement http://eslint.org/docs/rules/no-with semi: require or disallow use of semicolons instead of ASI http://eslint.org/docs/rules/semi space-return-throw-case: require a space after return, throw, and case http://eslint.org/docs/rules/space-return-throw-case strict: controls location of Use Strict Directives http://eslint.org/docs/rules/strict yoda: require or disallow Yoda conditions http://eslint.org/docs/rules/yoda
2015-11-06 02:22:17 +03:00
"linebreak-style": 2,
"new-cap": 2,
"new-parens": 2,
"no-array-constructor": 2,
"no-bitwise": 2,
"no-caller": 2,
"no-div-regex": 2,
"no-empty-label": 2,
"no-empty-pattern": 2,
"no-eval": 2,
"no-extend-native": 2,
"no-extra-bind": 2,
"no-floating-decimal": 2,
"no-implied-eval": 2,
"no-iterator": 2,
"no-label-var": 2,
"no-labels": 2,
"no-lone-blocks": 2,
"no-multi-str": 2,
"no-native-reassign": 2,
"no-new": 2,
"no-new-func": 2,
"no-new-object": 2,
"no-new-wrappers": 2,
"no-octal-escape": 2,
"no-proto": 2,
"no-return-assign": 2,
"no-script-url": 2,
"no-self-compare": 2,
"no-sequences": 2,
"no-shadow-restricted-names": 2,
"no-spaced-func": 2,
"no-trailing-spaces": 2,
"no-undef-init": 2,
"no-unexpected-multiline": 2,
"no-unused-expressions": 2,
"no-useless-call": 2,
"no-void": 2,
"no-with": 2,
"semi": 2,
"space-return-throw-case": 2,
"strict": [2, "global"],
"yoda": 2
}
}