Skip to content

fix(lint): remove import source check from is_global_react_import()#9023

Merged
siketyan merged 2 commits intomainfrom
fix/GH-9020
Feb 11, 2026
Merged

fix(lint): remove import source check from is_global_react_import()#9023
siketyan merged 2 commits intomainfrom
fix/GH-9020

Conversation

@siketyan
Copy link
Member

@siketyan siketyan commented Feb 10, 2026

Summary

Fixes #9020

Removed checking that the import source is react to align the behaviour with tsc, when jsxRuntime is set to reactClassic (equivalent to jsx: react in tsconfig).

Test Plan

Modified some snapshot tests.

Docs

N/A

@siketyan siketyan requested review from a team February 10, 2026 17:54
@siketyan siketyan self-assigned this Feb 10, 2026
@changeset-bot
Copy link

changeset-bot bot commented Feb 10, 2026

🦋 Changeset detected

Latest commit: 0a70067

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@biomejs/biome Patch
@biomejs/cli-win32-x64 Patch
@biomejs/cli-win32-arm64 Patch
@biomejs/cli-darwin-x64 Patch
@biomejs/cli-darwin-arm64 Patch
@biomejs/cli-linux-x64 Patch
@biomejs/cli-linux-arm64 Patch
@biomejs/cli-linux-x64-musl Patch
@biomejs/cli-linux-arm64-musl Patch
@biomejs/wasm-web Patch
@biomejs/wasm-bundler Patch
@biomejs/wasm-nodejs Patch
@biomejs/backend-jsonrpc Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels Feb 10, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 10, 2026

Walkthrough

This change relaxes import-source validation in is_global_react_import so that when javascript.jsxRuntime is reactClassic, imports named React are recognised regardless of their module source. Tests were updated to ensure noUnusedImports and useImportType accept React imported from custom or local modules, matching TypeScript's jsx=react behaviour.

Possibly related PRs

Suggested reviewers

  • ematipico
  • dyc3
  • mdevils
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: removing import source validation from is_global_react_import() function.
Description check ✅ Passed The description is directly related to the changeset, explaining the rationale and alignment with tsc behaviour when jsxRuntime is reactClassic.
Linked Issues check ✅ Passed The PR successfully addresses issue #9020 by removing import source verification, allowing any React-named import to be treated as the React binding regardless of module source.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the is_global_react_import() logic and updating affected test snapshots; no unrelated modifications present.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/GH-9020

No actionable comments were generated in the recent review. 🎉

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.changeset/funny-phones-read.md:
- Line 5: Replace the clunky sentence about jsxRuntime and import behavior with
a cleaner rewording: change the line that starts "When `javascript.jsxRuntime`
is set to `reactClassic`, `noUnusedImports` and `useImportType` rules now allows
..." to something like "When `javascript.jsxRuntime` is set to `reactClassic`,
the `noUnusedImports` and `useImportType` rules now allow importing the `React`
identifier from packages other than `react`, aligning the behavior with `tsc`
(`--jsx=react`), which also permits importing `React` from any package." Ensure
correct plural verb "allow" and remove "either"/"will" awkwardness so the
sentence reads fluently.

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 10, 2026

Merging this PR will not alter performance

✅ 58 untouched benchmarks
⏩ 95 skipped benchmarks1


Comparing fix/GH-9020 (0a70067) with main (bbe0e0c)

Open in CodSpeed

Footnotes

  1. 95 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@siketyan siketyan merged commit 8ef9d1d into main Feb 11, 2026
18 checks passed
@siketyan siketyan deleted the fix/GH-9020 branch February 11, 2026 07:49
@github-actions github-actions bot mentioned this pull request Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Linter Area: linter L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 React import checks are stricter than they should be

2 participants