From 4f60a0b3bd4732ce835f2027aa82edbb5ea6c7f9 Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Mon, 6 Jul 2020 10:13:27 +1000 Subject: [PATCH] chore: improve type safety of cli/js/compiler (#6647) --- cli/js/compiler.ts | 2 +- cli/js/ts_global.d.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cli/js/compiler.ts b/cli/js/compiler.ts index 905f5efb25..33fef4002f 100644 --- a/cli/js/compiler.ts +++ b/cli/js/compiler.ts @@ -245,6 +245,7 @@ class SourceFile { processed = false; sourceCode?: string; tsSourceFile?: ts.SourceFile; + versionHash!: string; url!: string; constructor(json: SourceFileJson) { @@ -445,7 +446,6 @@ class Host implements ts.CompilerHost { sourceFile.sourceCode, languageVersion ); - //@ts-ignore sourceFile.tsSourceFile.version = sourceFile.versionHash; delete sourceFile.sourceCode; } diff --git a/cli/js/ts_global.d.ts b/cli/js/ts_global.d.ts index dcdf4a3e46..a32e8b620d 100644 --- a/cli/js/ts_global.d.ts +++ b/cli/js/ts_global.d.ts @@ -29,5 +29,9 @@ declare global { disable(): void; getDuration(value: string): number; }; + + interface SourceFile { + version?: string; + } } }