-
-
Notifications
You must be signed in to change notification settings - Fork 27k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[Request] Opt out of tsconfig automation #5625
Comments
After further research, I can see this commit, which explains you do not support absolute path imports
But I was most certainly using absolute imports before this release went live, with the version of react-scripts that was on the master branch, so I'm curious how exactly it's not supported |
That's....disappointing. I've used absolute paths very successfully in large scale TypeScript projects - not sure why such a rule would be enforced so heavy-handedly here. |
These values are not supported and are no-op in Create React App. They are removed to prevent confusion and fix errors (so they show properly) in VSCode. Aliasing paths is a foot gun and isn't of much value when using VSCode or an IDE. Absolute imports ( |
Also, be sure to remove your |
Just because you think something could potentially be confusing doesn't mean it's a good reason to actively block people who know what they are doing from being able to use it. There is no technical reason as to why this feature native to TypeScript should be restricted in CRA. I thought CRA as a project was looking to move away from enforcing opinionated decisions on it's users? Aliasing paths is quite straightforward and is of great value even when using an IDE because you spend more time writing feature code and less time guessing how many From what I can see it was restricted because CRA does not automatically handle aliases in To me the addition of this restriction without any way to opt-out is clearly a regression. The capabilities of CRA have been reduced to no tangible benefit. |
I see some people are disappointed with some tsconfig restrictions. While CRA doesn't change this internally, my short term recommendation is that you use patch-package and simply remove the restrictions from your These days I don't stress at all when some lib doesn't do something I want, I just patch them using patch-package. Remember that CRA is an open source project, so you can change anything you want. |
Above is the result of running
yarn start
react-scripts v2.1.0
I use the following code so I can use absolute paths in my TypeScript files, but everytime I run the
yarn
command, everything gets blown out, and I can't run my projectIs there a way or could there be a way to opt out of
react-scripts
auto-generating the tsconfig?The text was updated successfully, but these errors were encountered: