{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/8529","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/8529/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/8529/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/8529/events","html_url":"https://github.com/Microsoft/TypeScript/issues/8529","id":153764287,"number":8529,"title":"Make default JSX mode \"react\"","user":{"login":"donaldpipowitch","id":1152805,"avatar_url":"https://avatars.githubusercontent.com/u/1152805?v=3","gravatar_id":"","url":"https://api.github.com/users/donaldpipowitch","html_url":"https://github.com/donaldpipowitch","followers_url":"https://api.github.com/users/donaldpipowitch/followers","following_url":"https://api.github.com/users/donaldpipowitch/following{/other_user}","gists_url":"https://api.github.com/users/donaldpipowitch/gists{/gist_id}","starred_url":"https://api.github.com/users/donaldpipowitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donaldpipowitch/subscriptions","organizations_url":"https://api.github.com/users/donaldpipowitch/orgs","repos_url":"https://api.github.com/users/donaldpipowitch/repos","events_url":"https://api.github.com/users/donaldpipowitch/events{/privacy}","received_events_url":"https://api.github.com/users/donaldpipowitch/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Accepting%20PRs","name":"Accepting PRs","color":"009800"},{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Committed","name":"Committed","color":"009800"},{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Effort:%20Easy","name":"Effort: Easy","color":"51bb51"},{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Suggestion","name":"Suggestion","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2016-05-09T12:23:02Z","updated_at":"2016-05-17T19:35:56Z","closed_at":null,"body":"To enable JSX syntax in TypeScript you need two steps:\r\n- add `\"jsx\": \"react\"` to `\"compilerOptions\"` in `tsconfig.json`\r\n- use `.tsx` extension\r\n\r\nThis is quite troublesome if you want to reuse certain generators/boilerplates/build scripts for us. It is also against the single source of truth principle and can be confusing. I recently stumbled over a bug where we used the `.tsx` extension, but hadn't configured the `tsconfig.json`.\r\n\r\nThere was a lot of discussion recently about changing the `.js` extension to `.mjs` to introduce ES6 modules to Node and many people are against that and prefer to have an additional flag in the `package.json`.\r\nI'd like to see the same for TypeScript and JSX:\r\n- the `.tsx` extension is purely optional\r\n- only `\"jsx\": \"react\"` in `tsconfig.json` is mandatory\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/219829243","html_url":"https://github.com/Microsoft/TypeScript/issues/8529#issuecomment-219829243","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/8529","id":219829243,"user":{"login":"mhegazy","id":8000722,"avatar_url":"https://avatars.githubusercontent.com/u/8000722?v=3","gravatar_id":"","url":"https://api.github.com/users/mhegazy","html_url":"https://github.com/mhegazy","followers_url":"https://api.github.com/users/mhegazy/followers","following_url":"https://api.github.com/users/mhegazy/following{/other_user}","gists_url":"https://api.github.com/users/mhegazy/gists{/gist_id}","starred_url":"https://api.github.com/users/mhegazy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhegazy/subscriptions","organizations_url":"https://api.github.com/users/mhegazy/orgs","repos_url":"https://api.github.com/users/mhegazy/repos","events_url":"https://api.github.com/users/mhegazy/events{/privacy}","received_events_url":"https://api.github.com/users/mhegazy/received_events","type":"User","site_admin":false},"created_at":"2016-05-17T19:35:56Z","updated_at":"2016-05-17T19:35:56Z","body":"you can always have .tsx only files everywhere. so now you need not worry about boilerplate code setup, you will have to give up on `<T>` type casts."}}