Skip to content

Commit

Permalink
forbid prop types functions not used as object properties #2662
Browse files Browse the repository at this point in the history
  • Loading branch information
ajkovar committed Jun 16, 2020
1 parent f09ce08 commit b16f49a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions lib/rules/forbid-prop-types.js
Expand Up @@ -93,10 +93,7 @@ module.exports = {
) {
value = value.object;
}
if (
value.type === 'CallExpression'
&& value.callee.type === 'MemberExpression'
) {
if (value.type === 'CallExpression') {
value = value.callee;
}
if (value.property) {
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/forbid-prop-types.js
Expand Up @@ -1482,7 +1482,7 @@ ruleTester.run('forbid-prop-types', rule, {
'};'
].join('\n'),
options: [{
forbid: ['any']
forbid: ['objectOf']
}],
errors: 1
}]
Expand Down

0 comments on commit b16f49a

Please sign in to comment.