[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
.js
to.tsx
and create atsconfig.json
file.They can optionally create a
tslint.json
file 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
.ts
and.tsx
file extensionstypescript
option toreact-app
babel preset (which enables@babel/preset-typescript
)flow
ortypescript
automatically by detecting.flowconfig
andtsconfig.json
flow
andtypescript
in the same projecttsconfig.prod.json
andtslint.prod.json
svg
,png
andjpg
importsPending improvements
tsconfig.json
andtslint.json
so 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-app
preset based oneslint-config-react-app
tsc -w
on its ownScreenshots
How to try this PR while it's not merged
git clone [email protected]:brunolemos/create-react-app.git
cd create-react-app
git checkout next-typescriptgit checkout v2-typescript-monorepo
yarn
cd packages/react-scripts/
yarn link
cd ~/your/projects/folder
npx create-react-app@next --scripts-version=2.0.0-next.3e165448 app-name
cd app-name
yarn link react-scripts
yarn start