Skip to content

Add options to choose JSX file extension .js or .jsx #9044

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

Closed
frogcjn opened this issue Jun 9, 2016 · 6 comments
Closed

Add options to choose JSX file extension .js or .jsx #9044

frogcjn opened this issue Jun 9, 2016 · 6 comments
Assignees
Labels
Help Wanted You can do this Suggestion An idea for TypeScript

Comments

@frogcjn
Copy link

frogcjn commented Jun 9, 2016

I want to keep jsx in the file content, so I choose:

        "jsx": "preserve"

but the generated file has jsx extension and ReactNative refuse to recognize this extension.

So there needs an option to let JSX format file using js extension.

@RyanCavanaugh RyanCavanaugh added the Suggestion An idea for TypeScript label Jun 9, 2016
@RyanCavanaugh RyanCavanaugh self-assigned this Jun 9, 2016
@dum3ng
Copy link

dum3ng commented Jun 28, 2016

Yeah I met the same problem.
I would like to see the compiled file with jsx expression because that's clear but I do not want the .jsx extension. React Native just does not recognize them.

@RyanCavanaugh RyanCavanaugh added the Help Wanted You can do this label Jun 28, 2016
@RyanCavanaugh
Copy link
Member

I'd propose an option preserveJs that retains JSX expressions but computes the filename as .js. This should be a fairly easy change if someone wants to send a PR for it

@jbaxleyiii
Copy link

@RyanCavanaugh I'd love to take this! Can you give me any other direction?

@jbaxleyiii
Copy link

Actually it looks like https://github.com/Microsoft/TypeScript/pull/9864/files targets this?

@basarat
Copy link
Contributor

basarat commented Aug 10, 2016

I'm a big fan of keeping jsx out of .js files :) but thats just my opinion and I haven't done react native 🌹

@ivogabe
Copy link
Contributor

ivogabe commented Mar 19, 2017

I think this can be closed, implemented in #13636.

@frogcjn frogcjn closed this as completed Mar 19, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Help Wanted You can do this Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

6 participants