Skip to content

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

x6eull
Copy link
Contributor

@x6eull x6eull commented Apr 19, 2025

Copy link

graphite-app bot commented Apr 19, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@github-actions github-actions bot added A-linter Area - Linter C-enhancement Category - New feature or request labels Apr 19, 2025
@x6eull x6eull marked this pull request as ready for review April 19, 2025 08:02
@x6eull x6eull force-pushed the feat/forward_ref_uses_ref branch from 4eed58c to 9862f48 Compare April 19, 2025 08:02
Copy link

codspeed-hq bot commented Apr 19, 2025

CodSpeed Instrumentation Performance Report

Merging #10506 will not alter performance

Comparing x6eull:feat/forward_ref_uses_ref (e0fefd8) with main (7664bd0)

Summary

✅ 36 untouched benchmarks

@Sysix
Copy link
Member

Sysix commented Apr 19, 2025

To fix the test run cargo test -p oxlint and then cargo insta review

@github-actions github-actions bot added the A-cli Area - CLI label Apr 19, 2025
@x6eull
Copy link
Contributor Author

x6eull commented Apr 19, 2025

To fix the test run cargo test -p oxlint and then cargo insta review

I updated the .snap and the test passes on my machine :)

@Sysix
Copy link
Member

Sysix commented Apr 19, 2025

Because this rule is applied by default, I would like to have a second pair of eyes on it

@camchenry camchenry self-requested a review April 20, 2025 03:11
};

check_forward_ref_inner(first_arg_as_exp, ctx);
}
Copy link
Contributor

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 ?

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)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cli Area - CLI A-linter Area - Linter C-enhancement Category - New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants