-
Notifications
You must be signed in to change notification settings - Fork 12.8k
"Referenced projects must have the new composite setting enabled" does not hold true #60465
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
Comments
When the docs say
what they mean is that if project A references project B, the latter must have ΒΉ) In your case ( |
I see. So solution-style references don't require |
Yes, at least that's been my understanding. |
I found that the TypeScript 5.7 RC release blog has confirmed this behavior:
|
We are only using `references` in a solution-style tsconfig. According to discussions at microsoft/TypeScript#60465, such usage doesn't require `composite: true` to be set in sub-configs. Removing this field loosens the constraints on these configs that all files to be explicitly listed in `files` or `includes`. After this change, type errors in source code would only be reported twice if they're also imported by unit test specs, in constrast to always be reported twice prior to the change. I know this is not ideal yet, but it's still an improvement, and might help catch some edge cases such as vuejs#437 (comment) In the long run, we should still keep an eye on vuejs#549 (pending vuejs/language-tools#4750). Cross-referencing might be a more intuitive configuration, and should be the desirable configuration if we opt into Vitest Browser Mode.
We are only using `references` in a solution-style tsconfig. According to discussions at microsoft/TypeScript#60465, such usage doesn't require `composite: true` to be set in sub-configs. Removing this field loosens the constraints on these configs that all files to be explicitly listed in `files` or `includes`. After this change, type errors in source code would only be reported twice if they're also imported by unit test specs, in contrast to always be reported twice prior to the change. I know this is not ideal yet, but it's still an improvement, and might help catch some edge cases such as vuejs#437 (comment) In the long run, we should still keep an eye on vuejs#549 (pending vuejs/language-tools#4750). Cross-referencing might be a more intuitive configuration, and should be the desirable configuration if we opt into Vitest Browser Mode.
This really needs to be clarified in the docs. The fact that you can use project references without composite, and without requiring create-vue already creates projects using this. |
π Search Terms
composite, project references, solution-style tsconfig
π Version & Regression Information
β― Playground Link
https://vite.new/react-ts
π» Code
The above link is a project created from the vite react-ts template (https://vite.new/react-ts).
It uses project references in
tsconfig.json
, but nocomposite: true
specified in bothtsconfig.app.json
andtsconfig.node.json
.On the other hand, the TypeScript handbook says:
π Actual behavior
The project builds (
npm run build
) successfully withoutcomposite: true
.π Expected behavior
If I understand correctly, the documentation means I have to specify
composite: true
when usingreferences
. I'd expect an error or warning if I didn't follow the guide.Additional information about the issue
I'm curious whether it's a bug or a feature.
If it's a bug, what's the expected behavior?
If it's a feature, I'd like to see the documentation updated accordingly.
The text was updated successfully, but these errors were encountered: