From 3391fe5890257173fe9b62817f87cd00cfcf5a6d Mon Sep 17 00:00:00 2001 From: walon Date: Sat, 23 Mar 2024 20:00:24 +0800 Subject: [PATCH] =?UTF-8?q?[change]=20typescript=E4=B8=8D=E5=86=8D?= =?UTF-8?q?=E9=A2=84=E7=95=99type=E5=85=B3=E9=94=AE=E5=AD=97=EF=BC=8C?= =?UTF-8?q?=E5=9B=A0=E4=B8=BA=E6=AD=A4=E5=AD=97=E6=AE=B5=E5=90=8D=E5=A4=AA?= =?UTF-8?q?=E5=B8=B8=E8=A7=81=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Luban.Typescript/CodeTarget/TypescriptCodeTargetBase.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Luban.Typescript/CodeTarget/TypescriptCodeTargetBase.cs b/src/Luban.Typescript/CodeTarget/TypescriptCodeTargetBase.cs index 7565ea4e..0bd60aeb 100644 --- a/src/Luban.Typescript/CodeTarget/TypescriptCodeTargetBase.cs +++ b/src/Luban.Typescript/CodeTarget/TypescriptCodeTargetBase.cs @@ -18,11 +18,12 @@ public abstract class TypescriptCodeTargetBase : AllInOneTemplateCodeTargetBase private static readonly HashSet s_preservedKeyWords = new() { // typescript preserved key words + // remove `type` because it's used frequently "abstract", "as", "any", "boolean", "break", "case", "catch", "class", "const", "continue", "debugger", "declare", "default", "delete", "do", "else", "enum", "export", "extends", "false", "finally", "for", "from", "function", "get", "if", "implements", "import", "in", "instanceof", "interface", "let", "module", "namespace", "new", "null", "number", "object", "package", "private", "protected", "public", "require", "return", "set", "static", "string", "super", "switch", - "symbol", "this", "throw", "true", "try", "type", "typeof", "undefined", "var", "void", "while", "with", "yield" + "symbol", "this", "throw", "true", "try", /*"type",*/ "typeof", "undefined", "var", "void", "while", "with", "yield" }; protected override IReadOnlySet PreservedKeyWords => s_preservedKeyWords;