Add sample `tsconfig.json` to docs for adding TypeScript to existing project
See original GitHub issueIt would be useful if the documentation for adding TypeScript included a sample tsconfig.json
for people who are upgrading existing projects. Currently the documentation states that one will be generated for you, but that only applies if you are initializing a new project.
In the meantime, for those who run into this issue, I created a dummy project and ran the initialization to get this config:
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "preserve"
},
"include": [
"src"
]
}
If this is the correct “default” config, then this can be added to or linked to the existing documentation page about TypeScript to make it easier for existing projects to convert.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Documentation - What is a tsconfig.json - TypeScript
The tsconfig.json file specifies the root files and the compiler options required to compile the project. JavaScript projects can use a jsconfig.json file ......
Read more >Setting up TypeScript project with tsconfig.json - LogicBig
This tutorial shows how to build a TypeScript project with the help of tsconfig.json. The file tsconfig.json is TypeScript specific and its ...
Read more >How to Set Up a Node.js Project with TypeScript
Learn how to add TypeScript support to Node.js projects. ... This file is called tsconfig.json , and you should place it at the...
Read more >TypeScript tutorial with Visual Studio Code
Let's start with a simple Hello World Node.js example. Create a new folder HelloWorld and launch VS Code. mkdir HelloWorld cd HelloWorld ...
Read more >Adding Typescript to your Existing Rails App - Honeybadger.io
The command above adds the TypeScript compiler to your project, which can be accessed using the npx tsc command. You can also install...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve just converted an existing, non-ejected CRA-based project from JavaScript to TypeScript, and I can confirm that the
tsconfig.json
file was generated for me.For reference, I’m on
react-scripts: 2.1.3
We have changed the template a few times. The template created when you create a project or change an existing project is identical (the new project actually calls the exact code).
If at any time you want to regenerate the file, you can just delete your
tsconfig.json
and re-runnpm start
.Maybe we can note that?