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

Set default "jsx" mode to react #27863

Closed
wants to merge 2 commits into from

Conversation

hasparus
Copy link

@hasparus hasparus commented Oct 12, 2018

Checklist:

  • There is an associated issue that is labeled
    'Bug' or 'help wanted' or is in the Community milestone
  • Code is up-to-date with the master branch
  • You've signed the CLA
  • Ask if this is actually needed
  • Run jake runtests locally -- they fail.
  • Fix failing unit tests
  • Update default value in the docs -- currently it's "Preserve"
  • Follow documentation section in contributing wiki.
    • This PR is a breaking change for people that ignore the error and depend on current default behavior.

Description

If compilerOptions.jsx is undefined we treat it like if it were JSXEmit.React.

I don't feel like this is the right and the most elegant solution and I didn't fix tests yet so this is WIP.
I feel I need some more stepping around the code to find a place to actually set default config values.

Compiler still logs error when JSX flag is not explicitly set.
IMO is not too pretty so I have a fix for it in separate PR (hasparus#1) I'd like to merge into this branch.

Solves #8529

Defaults compilerOptions.jsx to JSXEmit.React in getTransformers.
Commented out value of jsx in tsconfig.json after running `tsc --init`
is now "react".
@msftclas
Copy link

msftclas commented Oct 12, 2018

CLA assistant check
All CLA requirements met.

@RyanCavanaugh
Copy link
Member

Looks like this work in progress didn't quite finish - let us know (maybe in the linked issue) if we can help out with pointing you at similar PRs. Closing for now - thanks!

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.

3 participants