-
-
Notifications
You must be signed in to change notification settings - Fork 525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(lint): support some of wrapped hook calls in useExhaustiveDependencies #4964
Conversation
CodSpeed Performance ReportMerging #4964 will not alter performanceComparing Summary
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks!
Could you rebase this against the next
branch and add a changeset entry? Thanks!
@arendjr Thank you for your review. I will rebase it soon! |
Yes, that's preferable. We did a bunch of internal refactoring, even to internal Rust methods and APIs
I wanted to update the README.md, and add a note about it |
@ematipico Thank you for clarification! And I rebased to next branch & added a changeset. 🙏 |
…ncies Signed-off-by: Naoki Ikeguchi <naoki.ikeguchi@bitkey.jp>
Signed-off-by: Naoki Ikeguchi <naoki.ikeguchi@bitkey.jp>
fn unwrap_to_call_expression(expression: AnyJsExpression) -> Option<JsCallExpression> { | ||
match expression { | ||
AnyJsExpression::JsCallExpression(expr) => Some(expr), | ||
AnyJsExpression::JsParenthesizedExpression(expr) => { | ||
expr.expression().ok().and_then(unwrap_to_call_expression) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a recursion, which we tend to avoid when working with CSTs. Can you make it a loop? It shouldn't be too difficult.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ematipico Sorry, I didn't know that. I turned it into a loop in 45e9668.
Signed-off-by: Naoki Ikeguchi <me@s6n.jp>
Thanks! |
…ncies (biomejs#4964) Signed-off-by: Naoki Ikeguchi <naoki.ikeguchi@bitkey.jp> Signed-off-by: Naoki Ikeguchi <me@s6n.jp>
Summary
Fixes #1597 (except more edge cases)
This pull request adds support of some different styles of hook calls that are considered as "stable", including:
(useRef())
(doSomething(), useRef())
useRef()!
as
operatoruseRef() as T
satisfies
operatoruseRef() satisfies T
Note this doesn't cover all of edge cases.
Test Plan
Tests added.