-
Notifications
You must be signed in to change notification settings - Fork 12k
Don't enable skipLibCheck
in --strict
mode
#16696
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
Hi @cyrilletuzi, the So if a library was build with TypeScript 3.7, it cannot be consumed without Let me loop in @IgorMinar to see if we should disable More info about DTS compatibility issues can be found below: |
Hi @alan-agius4, thanks for your answer. As an Angular library author myself, I'm very aware of this problem. So I'll give you some feedback and some alternatives. Angular has always considered support of newer TypeScript versions as not priority, delaying this to the next minor release (eg., Angular 9.0 will only support TS 3.6, and TS 3.7 support should come in 9.1). While it's true it's not a priority for Angular itself, it's not true for Angular librairies. Indeed, a library should work with all v9 versions, including 9.0. It means it's not safe for an Angular library to use new features of TS 3.7 (like So as a library author, I've always restricted myself to:
I see 3 better alternatives than using
|
Couple of points to clear:
|
Thanks for the clarifications. I wasn't aware of TS 3.7 support. But note that it was just an example (same scenario happened and will continue to happen for each new major release), and that if Angular 9.0 final release still support TS 3.6 too, the issue will still be here for librairies authors. Given your feedback, I see a new alternative: would it be possible that |
@cyrilletuzi regarding your comment
Can you provide some examples? What I am aware of is that If a library ships a broken model, for instance: export interface Foo {
bar: InvalidType
} Where import { Foo} from 'foo';
export const x: Foo = {
bar: false
}; Another use-case where |
@alan-agius4 Indeed after some tests I couldn't find relevant cases. So I'll close this issue. |
I just talked to @DanielRosenwasser and he pointed out that |
@cyrilletuzi I also want to mention that TS tries to keep versions futureproof wrt the next minor. 3.6 was future proofed against some features that 3.7 was meant to include. That is to say, anytime you find incompatible typings, we'd like to know. It should be safe for library authors to use the upper bound of supported TS versions for Angular. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🚀 Feature request
Command (mark with an
x
)Description
I'm quite surprised by this move: #16682, which enables TypeScript
skipLibCheck
by default. From what I know, it's usually considered as a temporary workaround for issues that should be correctly resolved. While it may have performances and compatibility advantages, it degrades types strictness (ie. some real errors may not be reported anymore).It goes in an opposite way than the new
--strict
option in v9 that finally enables strict mode.Describe the solution you'd like
I won't argue on your choice to make
skipLibCheck
the default (I suppose it comes from some issues I'm not aware of), but is it possible to not enable it when the--strict
option has been provided, for people who wants to work with strict types?The text was updated successfully, but these errors were encountered: