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;