Skip to content

Commit 2381833

Browse files
committed
inline stripTailingPropInAssignment
1 parent 2a76ac9 commit 2381833

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

packages/eslint-plugin-react-hooks/src/ExhaustiveDeps.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,20 +1437,7 @@ function getDependency(node) {
14371437
)
14381438
) {
14391439
return getDependency(node.parent);
1440-
} else {
1441-
return stripTailingPropInAssignment(node);
1442-
}
1443-
}
1444-
1445-
/**
1446-
* Assuming () means the passed/returned node:
1447-
* (props) => (props)
1448-
* (props.foo) => (props.foo)
1449-
* (props.foo.bar) = X => (props.foo).bar = X
1450-
* (props.foo.bar.baz) = X => (props.foo.bar).baz
1451-
*/
1452-
function stripTailingPropInAssignment(node) {
1453-
if (
1440+
} else if (
14541441
node.type === 'MemberExpression' &&
14551442
node.parent &&
14561443
node.parent.type === 'AssignmentExpression'

0 commit comments

Comments
 (0)