Skip to content

Commit

Permalink
Don't call utils.isReturningJSX with 'ClassDeclaration' nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Wesitos committed May 30, 2021
1 parent 5217096 commit 5f30c25
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/rules/no-typos.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,9 @@ module.exports = {

if (
relatedComponent
&& (utils.isES6Component(relatedComponent.node) || utils.isReturningJSX(relatedComponent.node))
&& (node.parent && node.parent.type === 'AssignmentExpression' && node.parent.right)
&& (utils.isES6Component(relatedComponent.node) || (
relatedComponent.node.type !== 'ClassDeclaration' && utils.isReturningJSX(relatedComponent.node)))
&& (node.parent && node.parent.type === 'AssignmentExpression' && node.parent.right)
) {
reportErrorIfPropertyCasingTypo(node.parent.right, node.property, true);
}
Expand Down

0 comments on commit 5f30c25

Please sign in to comment.