Skip to content

Add JSX codefix if available#32281

Merged
RyanCavanaugh merged 4 commits into
microsoft:masterfrom
hopha95:fix-jsx-config
Aug 16, 2019
Merged

Add JSX codefix if available#32281
RyanCavanaugh merged 4 commits into
microsoft:masterfrom
hopha95:fix-jsx-config

Conversation

@hopha95

@hopha95 hopha95 commented Jul 7, 2019

Copy link
Copy Markdown
Contributor

Verified:

  • There is an associated issue in the Backlog milestone (required)
  • Code is up-to-date with the master branch
  • You've successfully run gulp runtests locally
  • There are new or updated unit tests validating the change

Fixes #31938

@msftclas

msftclas commented Jul 7, 2019

Copy link
Copy Markdown

CLA assistant check
All CLA requirements met.

@orta orta left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wow, nice work 👍

@RyanCavanaugh RyanCavanaugh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

true isn't a valid jsx value. We could default to "react" or "preserve" (open to feedback)

tsconfig.json:5:12 - error TS5024: Compiler option 'jsx' requires a value of type string.

5     "jsx": true
             ~~~~

@orta

orta commented Jul 15, 2019

Copy link
Copy Markdown
Contributor

I think "react" makes the most sense, "preserve" feels like a setting that was much more useful before people could run TypeScript through babel and now is a bit more edge-casey.

@andrewbranch

Copy link
Copy Markdown
Member

In DefinitelyTyped:

"jsx": "preserve": 49 results
"jsx": "react": 505 results

That matches my intuition as well.

@hopha95

hopha95 commented Jul 16, 2019

Copy link
Copy Markdown
Contributor Author

Thanks @RyanCavanaugh for the feedback. Fixed jsx: “react” and updated test.

@orta orta mentioned this pull request Jul 25, 2019
5 tasks
@DanielRosenwasser

DanielRosenwasser commented Jul 30, 2019

Copy link
Copy Markdown
Member

Just another 👍 to "react" because #8529

@RyanCavanaugh RyanCavanaugh merged commit 46b7972 into microsoft:master Aug 16, 2019
timsuchanek pushed a commit to timsuchanek/TypeScript that referenced this pull request Sep 11, 2019
* Add JSX codefix if available

* Update react jsx.

* Update diagnostic code.
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a fixit for adding "jsx: true" to the tsconfig

7 participants