From 20f6b752227db69659c71f58438e5ba784e531ec Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Wed, 17 Aug 2022 12:28:09 +0300 Subject: [PATCH 1/2] preserveConstEnums = false --- scripts/build.js | 8 ++++---- std/portable.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/build.js b/scripts/build.js index 986a41a664..6988dfd196 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -145,17 +145,17 @@ const diagnosticsPlugin = { } out.push(" " + key + " = " + messages[text]); }); - + out.push("\n}\n\n"); out.push("/** Translates a diagnostic code to its respective string. */\n"); out.push("export function diagnosticCodeToString(code: DiagnosticCode): string {\n switch (code) {\n"); - + Object.keys(messages).forEach(text => { out.push(" case " + messages[text] + ": return " + JSON.stringify(text) + ";\n"); }); - + out.push(" default: return \"\";\n }\n}\n"); - + const generated = out.join(""); fs.writeFileSync(path.join(dirname, "..", "src", "diagnosticMessages.generated.ts"), generated); return { diff --git a/std/portable.json b/std/portable.json index 1a1e427d21..f0a39db430 100644 --- a/std/portable.json +++ b/std/portable.json @@ -5,7 +5,7 @@ "module": "commonjs", "allowJs": true, "downlevelIteration": true, - "preserveConstEnums": true, + "preserveConstEnums": false, "typeRoots": [ "types" ], "types": [ "portable" ], "lib": ["esnext", "esnext.string"] From 4b1416abde75afb289e97477af97b846d0bf4e3c Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Wed, 17 Aug 2022 12:43:14 +0300 Subject: [PATCH 2/2] more --- std/portable.json | 2 -- tsconfig-base.json | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/std/portable.json b/std/portable.json index f0a39db430..2490ba4c62 100644 --- a/std/portable.json +++ b/std/portable.json @@ -4,8 +4,6 @@ "target": "esnext", "module": "commonjs", "allowJs": true, - "downlevelIteration": true, - "preserveConstEnums": false, "typeRoots": [ "types" ], "types": [ "portable" ], "lib": ["esnext", "esnext.string"] diff --git a/tsconfig-base.json b/tsconfig-base.json index 415a5fb820..10a2d884e4 100644 --- a/tsconfig-base.json +++ b/tsconfig-base.json @@ -1,11 +1,14 @@ { "compilerOptions": { + "strict": true, "alwaysStrict": true, "noImplicitAny": true, "noImplicitReturns": true, "noImplicitThis": true, "noEmitOnError": true, "strictNullChecks": true, - "experimentalDecorators": true + "experimentalDecorators": true, + "preserveConstEnums": false, + "downlevelIteration": true } }