Skip to content

Commit

Permalink
[Performance] prefer-exact-props improve performance for `Identifie…
Browse files Browse the repository at this point in the history
…r` visitor
  • Loading branch information
meowtec committed Jan 27, 2022
1 parent 2dfe98f commit 6b1b12a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rules/prefer-exact-props.js
Expand Up @@ -120,7 +120,7 @@ module.exports = {
},

Identifier(node) {
if (!utils.getParentStatelessComponent(node)) {
if (!utils.getStatelessComponent(node.parent)) {
return;
}

Expand Down
1 change: 1 addition & 0 deletions tests/lib/rules/prefer-exact-props.js
Expand Up @@ -91,6 +91,7 @@ ruleTester.run('prefer-exact-props', rule, {
foo: string
|}
function Component(props: Props) {
let someVar: { foo: string };
return <div />;
}
`,
Expand Down

0 comments on commit 6b1b12a

Please sign in to comment.