Skip to content

Port "fix: do not use JSX.ElementChildrenAttribute under jsx: react-jsx or jsx: react-jsxdev" #1067

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

Merged
merged 1 commit into from
Jun 5, 2025

Conversation

Andarist
Copy link
Contributor

@Andarist Andarist commented Jun 5, 2025

…t-jsx` or `jsx: react-jsxdev`"

Co-authored-by: uhyo <[email protected]>
@Copilot Copilot AI review requested due to automatic review settings June 5, 2025 14:11
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR ports a fix to prevent the use of JSX.ElementChildrenAttribute under react-jsx/react-jsxdev modes by removing the corresponding error baselines and updating the logic that determines the children property name.

  • Removed outdated error baseline files for react-jsx and react-jsxdev modes
  • Updated the JSX checker logic in internal/checker/jsx.go to return a hard-coded "children" property under these modes

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

File Description
testdata/baselines/reference/submodule/compiler/*.errors.txt and *.errors.txt.diff Removed expected error outputs to reflect the fix
internal/checker/jsx.go Updated getJsxElementChildrenPropertyName to return "children" for react-jsx and react-jsxdev modes
Comments suppressed due to low confidence (1)

internal/checker/jsx.go:1080

  • Consider adding an inline comment to explain why these specific JsxEmit modes are hard-coded to return "children". This will improve maintainability and assist future developers in understanding the rationale behind this logic.
if c.compilerOptions.Jsx == core.JsxEmitReactJSX || c.compilerOptions.Jsx == core.JsxEmitReactJSXDev {

@jakebailey jakebailey added this pull request to the merge queue Jun 5, 2025
Merged via the queue into microsoft:main with commit cddaf9f Jun 5, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants