fix(transformer): Always update jsx options from comments#10966
fix(transformer): Always update jsx options from comments#10966Dunqing merged 2 commits intooxc-project:mainfrom
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. |
CodSpeed Instrumentation Performance ReportMerging #10966 will not alter performanceComparing Summary
|
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue where JSX options were not correctly updated from comments due to an overly strict conditional check. Key changes include:
- Removing the additional conditional check for TypeScript's only_remove_type_imports in favor of a simpler check for JSX.
- Updating related test fixtures and snapshots to reflect the new behavior.
- Adjusting transformer logic to always update JSX options from comments.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tasks/transform_conformance/tests/babel-plugin-transform-typescript/test/fixtures/jsx/issue-10956/output.js | Updated output test to use the local h function for JSX. |
| tasks/transform_conformance/tests/babel-plugin-transform-typescript/test/fixtures/jsx/issue-10956/options.json | Updated options to include necessary plugins. |
| tasks/transform_conformance/tests/babel-plugin-transform-typescript/test/fixtures/jsx/issue-10956/input.tsx | Uses JSX pragmas appropriately with classic runtime mode. |
| tasks/transform_conformance/snapshots/oxc.snap.md | Updated snapshots reflecting the new behavior in transformer tests. |
| crates/oxc_transformer/src/lib.rs | Simplified conditional check for updating JSX options from comments. |
8030882 to
e21bde3
Compare
Merge activity
You must have a Graphite account in order to use the merge queue. Create an account and try again using this link |
Note
The explanation in the comment is incorrect because the
hfunction might be locally defined rather than imported. Removing the conditional check will fix the issue.@jsxRuntimepragma comment is ignored whentypescript.onlyRemoveTypeImports: trueis set #10956