Skip to content

Commit 3f70aba

Browse files
IgorMinarkara
authored andcommitted
fix(compiler-cli): disableTypeScriptVersionCheck should be applied even for older tsc versions (#22669)
Previously the flag would only disable the check in the case we tried to use newer tsc version. In g3 we sometimes take a while to update tsc, but as a prerequisite of that Angular needs to be updated first. This change enables us to update Angular and use it in g3 while g3 is being update to the required tsc. Of course extra care is required when this check is disabled, but since we control everything in g3, it's on us to get this right. I don't see any preexisting tests for this, and I'm not sure how to write them right now. I filed #22699 PR Close #22669
1 parent eb6fb2d commit 3f70aba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎packages/compiler-cli/src/transformers/program.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class AngularCompilerProgram implements Program {
7373
private host: CompilerHost, oldProgram?: Program) {
7474
this.rootNames = [...rootNames];
7575

76-
if (ts.version < '2.7.2' || (ts.version >= '2.8.0' && !options.disableTypeScriptVersionCheck)) {
76+
if ((ts.version < '2.7.2' || ts.version >= '2.8.0') && !options.disableTypeScriptVersionCheck) {
7777
throw new Error(
7878
`The Angular Compiler requires TypeScript >=2.7.2 and <2.8.0 but ${ts.version} was found instead.`);
7979
}

0 commit comments

Comments
 (0)