Skip to content

Commit

Permalink
[change] typescript不再预留type关键字,因为此字段名太常见了
Browse files Browse the repository at this point in the history
  • Loading branch information
pirunxi committed Mar 23, 2024
1 parent 8deeb4e commit 3391fe5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Luban.Typescript/CodeTarget/TypescriptCodeTargetBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ public abstract class TypescriptCodeTargetBase : AllInOneTemplateCodeTargetBase
private static readonly HashSet<string> 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<string> PreservedKeyWords => s_preservedKeyWords;
Expand Down

0 comments on commit 3391fe5

Please sign in to comment.