refactor(react): enforce shared scope analysis in helpers - #2165
Merged
Merged
Conversation
elecmonkey
added this pull request to stack #2166
September 15, 2026 08:54
fansenze
force-pushed
the
perf/react-scope-provider
branch
from
September 16, 2026 04:13
782a4a0 to
2576612
Compare
elecmonkey
force-pushed
the
perf/react-scope-provider
branch
from
September 16, 2026 10:33
2576612 to
e980f8a
Compare
elecmonkey
marked this pull request as ready for review
September 16, 2026 10:34
fansenze
approved these changes
Sep 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
React helpers that need lexical scope analysis currently construct scope graphs internally when no TypeChecker is available. This bypasses the shared file-level cache and allows multiple helpers and rules to rebuild the same graph.
Changes
A synthetic source-only benchmark ran eight affected React rules through the real linter. Program construction was excluded, and every iteration received a fresh file cache. Results are medians of five runs.
These fixtures exercise the no-TypeChecker fallback for bare memo, forwardRef, and createElement imports. Existing repository fixtures do not exercise this path densely enough to show a measurable change.