-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(dev): Add placeholder tsconfigs for tests #5169
Conversation
size-limit report 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me in the meanwhile, the only gripe I have with this change is, that it adds yet another tsconfig. Have you evaluated the following shuffling around of configs?:
[package]/tsconfig.test.json --> [package]/test/tsconfig.json (what you did here)
[package]/tsconfig.json --> [package]/src/tsconfig.json
Bonus:
- delete [package]/tsconfig.types.json and use [package]/src/tsconfig.json + cli options to generate types
Also, I would be in favor of moving the repo-root-level tsconfigs to a private package and importing them, not via a path but via node resolution. That seems the cleanest to me.
This works well because we can just put them in the |
I think we could merge this and make the tsconfig setup even cleaner later on |
Yeah, I know... The annoying thing, and one of the reasons we have so many tsconfigs to begin with, is that any path we use (in It would be really nice if you could do it like eslint, and have one file containing all of the different options, each with their corresponding include. It's not supported by TS, of course, but I wonder if we could rig it up ourselves...
I'm not sure I understand how this winds you up with fewer files - you get rid of the types file but add one in
Yeah, I think that's a fine idea, as long as we can get it to work with multiple tsconfigs. (Based on this comment and the one after it, I'm not sure if we'd have to do a hybrid package-name-file-name Before we do that, though, I think it's worth taking a step back and figuring out/deciding what the point of having both
Yeah, I'm going to do that, just so VSCode can stop freaking out at us, and we can figure the rest out separately. |
Mostly agree with you! Just wanna tie up an open thread here.
In my proposition we would move |
It is well-documented (1, 2, 3, 4, 5, 6) that VSCode doesn't support setups like ours, where multiple tsconfig files coexist in a single directory. Strangely, though, it is only recently that this has become a problem, with VSCode at random intervals forgetting that it's ever heard of
expect
ordescribe
(because it's not seeingtsconfig.test.json
, but taking a while to realize it).There is an open issue tracking the addition of support for this, but it's been open for a long time, with little movement. In the meantime, this solves the problem by adding placeholder
test/tsconfig.json
files to each package, each pointing to its correspondingtsconfig.test.ts
file. I went with this approach over simply moving and renaming the existing test tsconfigs because this allows us to stay consistent in having all flavors of tsconfig for a package live at the package root level, and provides an easy way to reverse this workaround, should VSCode ever fix the underlying problem.