-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Open
Labels
Good First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do thisSuggestionAn idea for TypeScriptAn idea for TypeScript
Milestone
Description
To enable JSX syntax in TypeScript you need two steps:
- add
"jsx": "react"
to"compilerOptions"
intsconfig.json
- use
.tsx
extension
This 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
.
There 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
.
I'd like to see the same for TypeScript and JSX:
- the
.tsx
extension is purely optional - only
"jsx": "react"
intsconfig.json
is mandatory
cogell, sindresorhus, MichaelGatesDev and blacksansa
Metadata
Metadata
Assignees
Labels
Good First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do thisSuggestionAn idea for TypeScriptAn idea for TypeScript