-
-
Notifications
You must be signed in to change notification settings - Fork 497
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
feat(linter) eslint-plugin-react(no-is-mounted) #1033
Conversation
b67c4a2
to
aad36a8
Compare
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.
Thank you for your first contribution!
CodSpeed Performance ReportMerging #1033 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.
Need a quick cargo fmt
.
By the way, the test in the plugin checks for MethodDefinition
, by there are no accompany failure case for it 🤔 https://github.com/jsx-eslint/eslint-plugin-react/blob/9da1bb0f4aa44849b56e8c2064afd582ea8b36f8/lib/rules/no-is-mounted.js#L43-L50
aad36a8
to
accacb6
Compare
I don't know how to achieve this in oxc parser. How do I walk the tree to the root? |
to see how to access parent nodes, take a look at logic where we do:
it returns an option of the parent node e.g. here: we are walking up the tree, checking the kind of the parent |
👋 @camc314 Is this how we're supposed to implement the ancestors' walk? I'm not sure but I don't think it would pass in our case. Even when I looked at the ESLint AST I can't find any references to "MethodDefinition" or "Property" in the tree 🤷 |
We also have the
You can try our playground https://web-infra-dev.github.io/oxc/playground/ It seems to be |
Closed in favour of #1550 |
No description provided.