diff --git a/lib/rules/default-props-match-prop-types.js b/lib/rules/default-props-match-prop-types.js index 6270d2042d..cf1597a311 100644 --- a/lib/rules/default-props-match-prop-types.js +++ b/lib/rules/default-props-match-prop-types.js @@ -82,12 +82,8 @@ module.exports = { 'Program:exit': function() { const list = components.list(); - Object.keys(list).forEach(component => { - // If no defaultProps could be found, we don't report anything. - if (!list[component].defaultProps) { - return; - } - + // If no defaultProps could be found, we don't report anything. + Object.keys(list).filter(component => list[component].defaultProps).forEach(component => { reportInvalidDefaultProps( list[component].declaredPropTypes, list[component].defaultProps || {}