diff options
Diffstat (limited to 'tools/node_modules/eslint/lib/rules/complexity.js')
-rw-r--r-- | tools/node_modules/eslint/lib/rules/complexity.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/node_modules/eslint/lib/rules/complexity.js b/tools/node_modules/eslint/lib/rules/complexity.js index 9f791e6de7..56e17ddf2f 100644 --- a/tools/node_modules/eslint/lib/rules/complexity.js +++ b/tools/node_modules/eslint/lib/rules/complexity.js @@ -41,13 +41,11 @@ module.exports = { properties: { maximum: { type: "integer", - minimum: 0, - default: 20 + minimum: 0 }, max: { type: "integer", - minimum: 0, - default: 20 + minimum: 0 } }, additionalProperties: false @@ -65,7 +63,10 @@ module.exports = { const option = context.options[0]; let THRESHOLD = 20; - if (typeof option === "object") { + if ( + typeof option === "object" && + (Object.prototype.hasOwnProperty.call(option, "maximum") || Object.prototype.hasOwnProperty.call(option, "max")) + ) { THRESHOLD = option.maximum || option.max; } else if (typeof option === "number") { THRESHOLD = option; |