Skip to content

Conversation

@kurtextrem
Copy link
Contributor

Hi! Thanks for the eslint rules. Really helpful.

We found the following example is not caught by the rules I've updated:

const myHandler = async (e) => { await foo() dummy(() => bar(e.currentTarget)) } 

The reason is, while await is in the scope of myHandler, currentTarget (or preventDefault()) is not. To fix it, we have to walk up the scopes and figure out if a parent scope matches the scope where await was found.

@kurtextrem kurtextrem requested a review from a team as a code owner October 31, 2024 16:03
@kurtextrem kurtextrem requested a review from gracepark October 31, 2024 16:03
@manuelpuyol
Copy link
Contributor

👋 @kurtextrem thanks for the contribution! Would you mind updating the tests with a new example for this case?

@kurtextrem
Copy link
Contributor Author

👋 @kurtextrem thanks for the contribution! Would you mind updating the tests with a new example for this case?

Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants