-
-
Notifications
You must be signed in to change notification settings - Fork 553
feat(linter): add react/forward_ref_uses_ref #10506
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
base: main
Are you sure you want to change the base?
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
4eed58c
to
9862f48
Compare
CodSpeed Instrumentation Performance ReportMerging #10506 will not alter performanceComparing Summary
|
…/oxc into feat/forward_ref_uses_ref
To fix the test run |
I updated the .snap and the test passes on my machine :) |
Because this rule is applied by default, I would like to have a second pair of eyes on it |
}; | ||
|
||
check_forward_ref_inner(first_arg_as_exp, ctx); | ||
} |
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.
@Sysix should this have a should_run
?
oxc/crates/oxc_linter/src/rules/react/no_children_prop.rs
Lines 97 to 101 in 8a2b250
fn should_run(&self, ctx: &ContextHost) -> bool { | |
// Only is JSX Context | |
// Only when React is installed, others frameworks can use JSX too | |
ctx.source_type().is_jsx() && ctx.frameworks().contains(FrameworkFlags::React) | |
} |
Related to #1022
Add react/forward-ref-uses-ref.
Rule doc: https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/forward-ref-uses-ref.md