Skip to content

Commit

Permalink
feat(cra): add support for typescript on cra
Browse files Browse the repository at this point in the history
Add missing flags to tsconfig that create-react-app either requires or sets a default if not set.
If this is not set, than create-react-app would add them automatically to the tsconfig.json file, which is annoying
  • Loading branch information
GabeDuarteM committed Jun 10, 2019
1 parent e88d241 commit b35645f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 4 additions & 1 deletion typescript/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
"typeRoots": ["../../../node_modules/@types", "../../../src/@types"],
"outDir": "../../../dist",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"allowJs": true
},
"include": ["../../../src/**/*"],
"exclude": [
Expand Down
9 changes: 8 additions & 1 deletion typescript/web.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
"extends": "./base.json",
"compilerOptions": {
"jsx": "preserve",
"lib": ["dom", "esnext"]
"lib": ["dom", "esnext"],

"declaration": false,
"skipLibCheck": false,
"module": "esnext",
"moduleResolution": "node",
"isolatedModules": true,
"noEmit": true
}
}

0 comments on commit b35645f

Please sign in to comment.