Disable TypeScript mismatch in ng-packagr
Asked Answered
S

1

1

In an Angular CLI project, when using an unsupported version of TypeScript you may get the following warning:

@angular/[email protected] requires typescript@'>=X.X.X <Y.Y.Y' but Z.Z.Z was found instead.
Using this version can result in undefined behaviour and difficult to debug problems.

It is possible to disable the TypeScript mismatch warning for the default project with the following command:

ng config cli.warnings.typescriptMismatch false

Now, when building an Angular library, ng-packagr throws this warning as an error, even with the typescriptMismatch setting set to false. Is it possible to temporarily disable this error? It is understood that this should not be done in a production environment, but it may be helpful when debugging issues that may be caused by TypeScript. The following StackOverflow question serves as an example use case.

Stillbirth answered 15/8, 2018 at 15:39 Comment(0)
U
9

You need to use disableTypeScriptVersionCheck under angularCompilerOptions In your tsconfig.

Uria answered 16/8, 2018 at 16:41 Comment(3)
For anyone interested, I did not find this option in the docs but it is listed in this source file.Stillbirth
@SamHerrmann I'd offer you a coffee (you need to come to Italy hahaha)! Thank you!Crossbreed
Just an update the link related to disableTypeScriptVersionCheckNamedropper

© 2022 - 2024 — McMap. All rights reserved.