[BACKUP] TypeScript support using Babel 7, with monorepo support #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds TypeScript support.
Closes facebook#4146
Closes facebook#2815
The user just needs to rename
.jsto.tsxand create atsconfig.jsonfile.They can optionally create a
tslint.jsonfile as well and it will be detected automatically.Type checking happens using
fork-ts-webpack-plugin.Someone please review, try it out and let me know how it could improve!
Includes
.tsand.tsxfile extensionstypescriptoption toreact-appbabel preset (which enables@babel/preset-typescript)flowortypescriptautomatically by detecting.flowconfigandtsconfig.jsonflowandtypescriptin the same projecttsconfig.prod.jsonandtslint.prod.jsonsvg,pngandjpgimportsPending improvements
tsconfig.jsonandtslint.jsonso the user doesn't need to create one? they would only need to rename the index.js to index.tsx instead. If we do this, we should do for .flowconfig as welltslint-config-react-apppreset based oneslint-config-react-apptsc -won its ownScreenshots
How to try this PR while it's not merged
git clone git@github.com:brunolemos/create-react-app.gitcd create-react-appgit checkout next-typescriptgit checkout v2-typescript-monorepoyarncd packages/react-scripts/yarn linkcd ~/your/projects/foldernpx create-react-app@next --scripts-version=2.0.0-next.3e165448 app-namecd app-nameyarn link react-scriptsyarn start