Skip to content
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

Add JSX codefix if available #32281

Merged
merged 4 commits into from
Aug 16, 2019
Merged

Conversation

hoangpham95
Copy link
Contributor

@hoangpham95 hoangpham95 commented Jul 7, 2019

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
Copy link

msftclas commented Jul 7, 2019

CLA assistant check
All CLA requirements met.

Copy link
Contributor

@orta orta left a comment

Choose a reason for hiding this comment

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

Wow, nice work 👍

Copy link
Member

@RyanCavanaugh RyanCavanaugh left a comment

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
Copy link
Contributor

orta commented Jul 15, 2019

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
Member

In DefinitelyTyped:

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

That matches my intuition as well.

@hoangpham95
Copy link
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
Copy link
Member

DanielRosenwasser commented Jul 30, 2019

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.
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.

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