No
tsconfig.jsonConfig files like tsconfig should be project specific.
I have same problem that existing tsconfig.json is overwrited by react-scripts when I run npm start. It seem react-scripts in current version will generate tsconfig.json automatically when it find .ts files in project. So I keep my project-specific tsconfig.json by reinstall react-scripts@1 instead of current version(2.1.1).
Yes, it is not a bug, but its feature puzzle me.😅
Create React App only supports certain TypeScript features. Because of this, the tsconfig.json is modified to be in compliance.
There should be an option to opt-out of this auto editing of tsconfig.json
@JaceHensley if you "opt-out" Create React App wouldn't work. This is not optional.
Hmm maybe it was just how I was using it but I had added an express server at the root of the directory and the include: ['src'] was causing the server code to not be analyzed.
I've since moved the client code to a sub project of the server with different tsconfigs so not a problem for me anymore 🤷♂️
Well, there are many problems actually. I was able to make absolute imports work but I had to use this workaround. I understand why would you want to somehow control tsconfig but I don't think it is a good idea to enforce whatever good practices you think are the best.
https://github.com/developer239/node-typescript-react-web/blob/master/tsconfig.paths.json
It should be possible to enforce only things that are necessary for running CRA and ignore the rest? 🙂
Btw I would like to know if there are people using CRA and typescript _without_ absolute imports. That has to be terrible.
@developer239 CRA should always "just" work. If we don't enforce or restrict certain features we will break functionality or have inconsistencies. There was no deliberate choice to disable absolute imports in Typescript because we don't want that feature but because it hasn't been implemented in such a way that it is consistent and will always work.
We are currently working on absolute imports for both TypeScript and JavaScript. You can track the progress here: https://github.com/facebook/create-react-app/pull/6116
Most helpful comment
@developer239 CRA should always "just" work. If we don't enforce or restrict certain features we will break functionality or have inconsistencies. There was no deliberate choice to disable absolute imports in Typescript because we don't want that feature but because it hasn't been implemented in such a way that it is consistent and will always work.
We are currently working on absolute imports for both TypeScript and JavaScript. You can track the progress here: https://github.com/facebook/create-react-app/pull/6116