summaryrefslogtreecommitdiff
path: root/tools/node_modules/eslint/lib/rules/max-depth.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/node_modules/eslint/lib/rules/max-depth.js')
-rw-r--r--tools/node_modules/eslint/lib/rules/max-depth.js13
1 files changed, 6 insertions, 7 deletions
diff --git a/tools/node_modules/eslint/lib/rules/max-depth.js b/tools/node_modules/eslint/lib/rules/max-depth.js
index 500e931881..3b997e21bc 100644
--- a/tools/node_modules/eslint/lib/rules/max-depth.js
+++ b/tools/node_modules/eslint/lib/rules/max-depth.js
@@ -32,11 +32,13 @@ module.exports = {
properties: {
maximum: {
type: "integer",
- minimum: 0
+ minimum: 0,
+ default: 4
},
max: {
type: "integer",
- minimum: 0
+ minimum: 0,
+ default: 4
}
},
additionalProperties: false
@@ -59,11 +61,8 @@ module.exports = {
option = context.options[0];
let maxDepth = 4;
- if (typeof option === "object" && Object.prototype.hasOwnProperty.call(option, "maximum") && typeof option.maximum === "number") {
- maxDepth = option.maximum;
- }
- if (typeof option === "object" && Object.prototype.hasOwnProperty.call(option, "max") && typeof option.max === "number") {
- maxDepth = option.max;
+ if (typeof option === "object") {
+ maxDepth = option.maximum || option.max;
}
if (typeof option === "number") {
maxDepth = option;