-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
TS 5.6 requires composite projects with noEmit to have fully accessible types, unlike 5.5 #59951
Comments
Declaration error reporting if enabled is intended and was added as part of #59065 |
@sheetalkamat Is there a way to go back to the 5.5 behaviour with configuration? For these projects we don't really care about these specific errors that make it impossible to generate type declarations since nothing depends on them, and sometimes they're very hard to fix when we depend on external libraries. |
Not really. Apart from disabling declaration there is no such option. Composite projects cannot disable declaration though |
This feels like a bit of a difficult breaking change for 5.6 then that we have no easy way to recover from. It'd be nice to have a way to get back to this specific 5.5 quirk if that's possible. For clarity, this error is fine (and expected) for 95% of the projects in our large composite project monorepo, but for some things it suddenly makes it impossible to bring in older projects that don't emit into our composite project (where they would start depending on newer, cleaner code). In 5.5 and older, setting noEmit on these projects was perfect: it makes it impossible to depend on them in a composite project (exactly what we want) and theseΒ types that cannot be named weren't a problem. |
Hello π But this change doesn't seem to be listed in https://devblogs.microsoft.com/typescript/announcing-typescript-5-6/ (or I may have missed it) Also, a thing that is weird is that during the update, I was initially facing just a few errors. And as soon as I fixed those, hundreds of new TS4023/TS4058/TS9006 errors appeared |
It also happened to me |
π Search Terms
TS2742, TS7056, TS9006, TS4058, TS4023, noEmit, composite, 5.6
π Version & Regression Information
β― Playground Link
https://github.com/Ambroos/ts-56-composite-project-noemit
π» Code
file: Internal.ts
file: index.ts
file: tsconfig.json
π Actual behavior
In TS 5.6.2, run
tsc
and get error:This is the error in the sample project linked above (or created with the files from the code part). In our actual repo a large amount of new errors appeared that are related: TS2742, TS7056, TS9006, TS4058, TS4023.
π Expected behavior
No errors, like 5.5.4 and older.
Additional information about the issue
This only happens in composite projects, even when not using
--build
. We have a large composite project, but the oldest parts of our code live in projects that don't emit since no-one is allowed to depend on them (they're apps that get built as-is).In the past, when not emitting type declarations, it was OK to reference types that cannot be named, even in incremental compilation / composite projects. Now however it looks like because
.tsbuildinfo
is always generated, making code able to be emitted seems to have become required.Maybe this is intentional, but it would be nice to still have some escape hatch for these types of composite project parts that don't actually need to emit declarations, they just need to be checked and transpiled.
The text was updated successfully, but these errors were encountered: