Bug 1436389 - Update complexity rules to adapt for the algorithm in the new ESLint. r=mossop

MozReview-Commit-ID: 1LlfamNvBEM

--HG--
extra : rebase_source : 8e41e5a5f67bfd43444fde25287cb3709452a349
This commit is contained in:
Mark Banner 2018-02-07 16:16:09 +00:00
Родитель 4cd77e3a20
Коммит 2fd2fd7199
11 изменённых файлов: 12 добавлений и 10 удалений

Просмотреть файл

@ -3,7 +3,7 @@
module.exports = {
"rules": {
// Warn about cyclomatic complexity in functions.
"complexity": ["error", 42],
"complexity": ["error", 47],
// XXX These are rules that are enabled in the recommended configuration, but
// disabled here due to failures when initially implemented. They should be

Просмотреть файл

@ -4,7 +4,7 @@ module.exports = {
"rules": {
// XXX Bug 1326071 - This should be reduced down - probably to 20 or to
// be removed & synced with the mozilla/recommended value.
"complexity": ["error", {"max": 40}],
"complexity": ["error", {"max": 44}],
// Disallow empty statements. This will report an error for:
// try { something(); } catch (e) {}

Просмотреть файл

@ -642,6 +642,7 @@
aMaxTotalProgress);
},
/* eslint-disable complexity */
onStateChange(aWebProgress, aRequest, aStateFlags, aStatus) {
if (!aRequest)
return;
@ -843,6 +844,7 @@
this.mStateFlags = aStateFlags;
this.mStatus = aStatus;
},
/* eslint-enable complexity */
onLocationChange(aWebProgress, aRequest, aLocation,
aFlags) {

Просмотреть файл

@ -4,7 +4,7 @@ module.exports = {
"rules": {
"block-scoped-var": "error",
"comma-dangle": ["error", "always-multiline"],
"complexity": ["error", {"max": 21}],
"complexity": ["error", {"max": 22}],
"indent-legacy": ["error", 2, {"SwitchCase": 1, "ArrayExpression": "first", "ObjectExpression": "first"}],
"max-nested-callbacks": ["error", 3],
"new-parens": "error",

Просмотреть файл

@ -58,7 +58,7 @@ module.exports = {
"comma-dangle": ["error", "always-multiline"],
// Warn about cyclomatic complexity in functions.
"complexity": ["error", {"max": 20}],
"complexity": ["error", {"max": 26}],
// Enforce dots on the next line with property name.
"dot-location": ["error", "property"],

Просмотреть файл

@ -81,7 +81,7 @@ module.exports = {
// impair readability, but also not required either.
"comma-dangle": "off",
// Warn about cyclomatic complexity in functions.
"complexity": ["error", 35],
"complexity": ["error", 53],
// Don't warn for inconsistent naming when capturing this (not so important
// with auto-binding fat arrow functions).
"consistent-this": "off",

Просмотреть файл

@ -4,7 +4,7 @@ module.exports = {
rules: {
// XXX Bug 1326071 - This should be reduced down - probably to 20 or to
// be removed & synced with the mozilla/recommended value.
"complexity": ["error", 41],
"complexity": ["error", 44],
"mozilla/no-task": "error",
}

Просмотреть файл

@ -5,7 +5,7 @@ module.exports = {
"rules": {
// XXX Bug 1358949 - This should be reduced down - probably to 20 or to
// be removed & synced with the mozilla/recommended value.
"complexity": ["error", 43],
"complexity": ["error", 56],
"no-unused-vars": ["error", {"args": "none", "vars": "local", "varsIgnorePattern": "^(ids|ignored|unused)$"}],
}

Просмотреть файл

@ -9,7 +9,7 @@ module.exports = {
"block-scoped-var": "error",
"comma-dangle": ["error", "always-multiline"],
complexity: ["error", {
max: 20,
max: 23,
}],
curly: ["error", "all"],
"dot-location": ["error", "property"],

Просмотреть файл

@ -5,7 +5,7 @@ module.exports = {
// Warn about cyclomatic complexity in functions.
// XXX Bug 1326071 - This should be reduced down - probably to 20 or to
// be removed & synced with the mozilla/recommended value.
"complexity": ["error", {"max": 60}],
"complexity": ["error", {"max": 68}],
"no-unused-vars": ["error", {"args": "none", "varsIgnorePattern": "^(Cc|Ci|Cr|Cu|EXPORTED_SYMBOLS)$"}],
}

Просмотреть файл

@ -119,7 +119,7 @@ module.exports = {
// Warn about cyclomatic complexity in functions.
// XXX Get this down to 20?
"complexity": ["error", 32],
"complexity": ["error", 34],
// Don't require spaces around computed properties
"computed-property-spacing": ["error", "never"],