diff --git a/lib/config/validation.js b/lib/config/validation.js index bdb65f6890cf8c59aa7f4bf9c6207fe946879df7..673fdc6474e2f7a914652dc9053f21c03dad5e6e 100644 --- a/lib/config/validation.js +++ b/lib/config/validation.js @@ -96,30 +96,30 @@ function validateConfig(config) { depName: 'Configuration Error', message: `Configuration option \`${key}\` should be a list (Array)`, }); - } else if (key === 'extends') { - for (const subval of val) { - if (isString(subval) && subval.match(/^:timezone(.+)$/)) { - const [, timezone] = subval.match(/^:timezone\((.+)\)$/); - const [validTimezone, errorMessage] = hasValidTimezone( - timezone - ); - if (!validTimezone) { - errors.push({ - depName: 'Configuration Error', - message: errorMessage, - }); - } - } - } } else { - // eslint-disable-next-line no-loop-func - val.forEach(subval => { + for (const subval of val) { if (isObject(subval)) { const subValidation = module.exports.validateConfig(subval); warnings = warnings.concat(subValidation.warnings); errors = errors.concat(subValidation.errors); } - }); + } + if (key === 'extends') { + for (const subval of val) { + if (isString(subval) && subval.match(/^:timezone(.+)$/)) { + const [, timezone] = subval.match(/^:timezone\((.+)\)$/); + const [validTimezone, errorMessage] = hasValidTimezone( + timezone + ); + if (!validTimezone) { + errors.push({ + depName: 'Configuration Error', + message: errorMessage, + }); + } + } + } + } } } else if (type === 'string') { if (!isString(val)) {