From 5c80586c598ae856f1102ee3109eaf10311fce18 Mon Sep 17 00:00:00 2001 From: James <5511220+Zamiell@users.noreply.github.com> Date: Thu, 23 Jun 2022 12:29:51 -0400 Subject: [PATCH 01/11] feat: enum expressions --- src/lib/converter/symbols.ts | 55 ++++++++++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 9 deletions(-) diff --git a/src/lib/converter/symbols.ts b/src/lib/converter/symbols.ts index b326cc104..b1a9a8ea1 100644 --- a/src/lib/converter/symbols.ts +++ b/src/lib/converter/symbols.ts @@ -868,10 +868,17 @@ function isEnumLike(checker: ts.TypeChecker, type: ts.Type, location: ts.Node) { return type.getProperties().every((prop) => { const propType = checker.getTypeOfSymbolAtLocation(prop, location); - return propType.isStringLiteral() || propType.isNumberLiteral(); + return isValidEnumProperty(propType); }); } +function isValidEnumProperty(type: ts.Type) { + return hasAnyFlag( + type.flags, + ts.TypeFlags.NumberLike | ts.TypeFlags.StringLike + ); +} + function convertVariableAsEnum( context: Context, symbol: ts.Symbol, @@ -895,14 +902,11 @@ function convertVariableAsEnum( void 0 ); - const propType = context.checker.getTypeOfSymbolAtLocation( - prop, - declaration - ); - assert(propType.isStringLiteral() || propType.isNumberLiteral()); - - reflection.defaultValue = JSON.stringify(propType.value); - reflection.type = new LiteralType(propType.value); + const enumMemberValue = getEnumMemberValue(context, declaration, prop); + if (typeof enumMemberValue === "string" || typeof enumMemberValue === "number") { + reflection.defaultValue = JSON.stringify(enumMemberValue); + reflection.type = new LiteralType(enumMemberValue); + } rc.finalizeDeclarationReflection(reflection, prop, void 0); } @@ -911,6 +915,39 @@ function convertVariableAsEnum( return ts.SymbolFlags.TypeAlias; } +function getEnumMemberValue( + context: Context, + declaration: ts.VariableDeclaration, + prop: ts.Symbol +): unknown | undefined { + const propType = context.checker.getTypeOfSymbolAtLocation( + prop, + declaration + ); + + // The trivial case is a string or number literal. + if (propType.isStringLiteral() || propType.isNumberLiteral()) { + return propType.value; + } + + // Handle expressions that resolve to a string or number value. + const propDeclarations = prop.getDeclarations(); + if (propDeclarations === undefined) { + return undefined; + } + + const firstPropDeclaration = propDeclarations[0]; + if ( + firstPropDeclaration === undefined || + !ts.isPropertyAssignment(firstPropDeclaration) + ) { + return undefined; + } + + const propCode = firstPropDeclaration.initializer.getText(); + return eval(propCode); +} + function convertVariableAsFunction( context: Context, symbol: ts.Symbol, From bc050a5a5b246807a3aa6333122665c25a753cdd Mon Sep 17 00:00:00 2001 From: James <5511220+Zamiell@users.noreply.github.com> Date: Thu, 23 Jun 2022 13:52:44 -0400 Subject: [PATCH 02/11] update specs --- src/test/converter/js/specs.json | 227 ++++++++++++++----------------- 1 file changed, 101 insertions(+), 126 deletions(-) diff --git a/src/test/converter/js/specs.json b/src/test/converter/js/specs.json index f0d24429f..1c2e4aed6 100644 --- a/src/test/converter/js/specs.json +++ b/src/test/converter/js/specs.json @@ -85,7 +85,51 @@ "comment": {}, "children": [ { - "id": 17, + "id": 10, + "name": "ColumnType", + "kind": 8, + "kindString": "Enumeration", + "flags": {}, + "comment": {}, + "children": [ + { + "id": 12, + "name": "NUMBER", + "kind": 16, + "kindString": "Enumeration Member", + "flags": {}, + "type": { + "type": "literal", + "value": "number" + }, + "defaultValue": "\"number\"" + }, + { + "id": 11, + "name": "STRING", + "kind": 16, + "kindString": "Enumeration Member", + "flags": {}, + "type": { + "type": "literal", + "value": "string" + }, + "defaultValue": "\"string\"" + } + ], + "groups": [ + { + "title": "Enumeration Members", + "kind": 16, + "children": [ + 12, + 11 + ] + } + ] + }, + { + "id": 15, "name": "AlsoInterfaceIsh", "kind": 256, "kindString": "Interface", @@ -95,7 +139,7 @@ }, "children": [ { - "id": 19, + "id": 17, "name": "bar", "kind": 1024, "kindString": "Property", @@ -109,7 +153,7 @@ } }, { - "id": 18, + "id": 16, "name": "foo", "kind": 1024, "kindString": "Property", @@ -128,21 +172,21 @@ "title": "Properties", "kind": 1024, "children": [ - 19, - 18 + 17, + 16 ] } ] }, { - "id": 15, + "id": 13, "name": "InterfaceIsh", "kind": 256, "kindString": "Interface", "flags": {}, "children": [ { - "id": 16, + "id": 14, "name": "foo", "kind": 1024, "kindString": "Property", @@ -161,24 +205,13 @@ "title": "Properties", "kind": 1024, "children": [ - 16 + 14 ] } ] }, { - "id": 14, - "name": "ColumnType", - "kind": 4194304, - "kindString": "Type alias", - "flags": {}, - "type": { - "type": "intrinsic", - "name": "string" - } - }, - { - "id": 44, + "id": 42, "name": "Foo", "kind": 4194304, "kindString": "Type alias", @@ -186,21 +219,21 @@ "type": { "type": "reflection", "declaration": { - "id": 45, + "id": 43, "name": "__type", "kind": 65536, "kindString": "Type literal", "flags": {}, "signatures": [ { - "id": 46, + "id": 44, "name": "__type", "kind": 4096, "kindString": "Call signature", "flags": {}, "parameters": [ { - "id": 47, + "id": 45, "name": "args", "kind": 32768, "kindString": "Parameter", @@ -226,7 +259,7 @@ } }, { - "id": 30, + "id": 28, "name": "HasReturnTag", "kind": 4194304, "kindString": "Type alias", @@ -234,14 +267,14 @@ "type": { "type": "reflection", "declaration": { - "id": 31, + "id": 29, "name": "__type", "kind": 65536, "kindString": "Type literal", "flags": {}, "signatures": [ { - "id": 32, + "id": 30, "name": "__type", "kind": 4096, "kindString": "Call signature", @@ -256,7 +289,7 @@ } }, { - "id": 42, + "id": 40, "name": "Identity", "kind": 4194304, "kindString": "Type alias", @@ -266,7 +299,7 @@ }, "typeParameter": [ { - "id": 43, + "id": 41, "name": "T", "kind": 131072, "kindString": "Type parameter", @@ -278,19 +311,19 @@ ], "type": { "type": "reference", - "id": 43, + "id": 41, "name": "T" } }, { - "id": 33, + "id": 31, "name": "IdentityFn", "kind": 4194304, "kindString": "Type alias", "flags": {}, "typeParameter": [ { - "id": 37, + "id": 35, "name": "T", "kind": 131072, "kindString": "Type parameter", @@ -300,35 +333,35 @@ "type": { "type": "reflection", "declaration": { - "id": 34, + "id": 32, "name": "__type", "kind": 65536, "kindString": "Type literal", "flags": {}, "signatures": [ { - "id": 35, + "id": 33, "name": "__type", "kind": 4096, "kindString": "Call signature", "flags": {}, "parameters": [ { - "id": 36, + "id": 34, "name": "data", "kind": 32768, "kindString": "Parameter", "flags": {}, "type": { "type": "reference", - "id": 37, + "id": 35, "name": "T" } } ], "type": { "type": "reference", - "id": 37, + "id": 35, "name": "T" } } @@ -337,7 +370,7 @@ } }, { - "id": 22, + "id": 20, "name": "IntersectionType", "kind": 4194304, "kindString": "Type alias", @@ -351,14 +384,14 @@ { "type": "reflection", "declaration": { - "id": 23, + "id": 21, "name": "__type", "kind": 65536, "kindString": "Type literal", "flags": {}, "children": [ { - "id": 24, + "id": 22, "name": "x", "kind": 1024, "kindString": "Property", @@ -374,7 +407,7 @@ "title": "Properties", "kind": 1024, "children": [ - 24 + 22 ] } ] @@ -383,14 +416,14 @@ { "type": "reflection", "declaration": { - "id": 25, + "id": 23, "name": "__type", "kind": 65536, "kindString": "Type literal", "flags": {}, "children": [ { - "id": 26, + "id": 24, "name": "y", "kind": 1024, "kindString": "Property", @@ -406,7 +439,7 @@ "title": "Properties", "kind": 1024, "children": [ - 26 + 24 ] } ] @@ -416,7 +449,7 @@ } }, { - "id": 27, + "id": 25, "name": "NoReturnTag", "kind": 4194304, "kindString": "Type alias", @@ -424,14 +457,14 @@ "type": { "type": "reflection", "declaration": { - "id": 28, + "id": 26, "name": "__type", "kind": 65536, "kindString": "Type literal", "flags": {}, "signatures": [ { - "id": 29, + "id": 27, "name": "__type", "kind": 4096, "kindString": "Call signature", @@ -446,7 +479,7 @@ } }, { - "id": 20, + "id": 18, "name": "ObjectAlias", "kind": 4194304, "kindString": "Type alias", @@ -462,7 +495,7 @@ } }, { - "id": 38, + "id": 36, "name": "OptionalArg", "kind": 4194304, "kindString": "Type alias", @@ -470,21 +503,21 @@ "type": { "type": "reflection", "declaration": { - "id": 39, + "id": 37, "name": "__type", "kind": 65536, "kindString": "Type literal", "flags": {}, "signatures": [ { - "id": 40, + "id": 38, "name": "__type", "kind": 4096, "kindString": "Call signature", "flags": {}, "parameters": [ { - "id": 41, + "id": 39, "name": "data", "kind": 32768, "kindString": "Parameter", @@ -507,7 +540,7 @@ } }, { - "id": 21, + "id": 19, "name": "UnionType", "kind": 4194304, "kindString": "Type alias", @@ -529,63 +562,6 @@ ] } }, - { - "id": 10, - "name": "ColumnType", - "kind": 32, - "kindString": "Variable", - "flags": { - "isConst": true - }, - "comment": {}, - "type": { - "type": "reflection", - "declaration": { - "id": 11, - "name": "__type", - "kind": 65536, - "kindString": "Type literal", - "flags": {}, - "children": [ - { - "id": 13, - "name": "NUMBER", - "kind": 1024, - "kindString": "Property", - "flags": {}, - "type": { - "type": "intrinsic", - "name": "string" - }, - "defaultValue": "\"number\"" - }, - { - "id": 12, - "name": "STRING", - "kind": 1024, - "kindString": "Property", - "flags": {}, - "type": { - "type": "intrinsic", - "name": "string" - }, - "defaultValue": "\"string\"" - } - ], - "groups": [ - { - "title": "Properties", - "kind": 1024, - "children": [ - 13, - 12 - ] - } - ] - } - }, - "defaultValue": "..." - }, { "id": 7, "name": "usedFoo", @@ -627,35 +603,34 @@ } ], "groups": [ + { + "title": "Enumerations", + "kind": 8, + "children": [ + 10 + ] + }, { "title": "Interfaces", "kind": 256, "children": [ - 17, - 15 + 15, + 13 ] }, { "title": "Type Aliases", "kind": 4194304, "children": [ - 14, - 44, - 30, 42, - 33, - 22, - 27, + 28, + 40, + 31, 20, - 38, - 21 - ] - }, - { - "title": "Variables", - "kind": 32, - "children": [ - 10 + 25, + 18, + 36, + 19 ] }, { From d41b55b1873bd2e8e40fab4a87d4eb71aabbc8ad Mon Sep 17 00:00:00 2001 From: James <5511220+Zamiell@users.noreply.github.com> Date: Thu, 23 Jun 2022 14:05:15 -0400 Subject: [PATCH 03/11] prettier --- src/lib/converter/symbols.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/converter/symbols.ts b/src/lib/converter/symbols.ts index b1a9a8ea1..af47ec62a 100644 --- a/src/lib/converter/symbols.ts +++ b/src/lib/converter/symbols.ts @@ -903,7 +903,10 @@ function convertVariableAsEnum( ); const enumMemberValue = getEnumMemberValue(context, declaration, prop); - if (typeof enumMemberValue === "string" || typeof enumMemberValue === "number") { + if ( + typeof enumMemberValue === "string" || + typeof enumMemberValue === "number" + ) { reflection.defaultValue = JSON.stringify(enumMemberValue); reflection.type = new LiteralType(enumMemberValue); } From 331a6250201d7465aa19803a2d42b6b94527c462 Mon Sep 17 00:00:00 2001 From: James <5511220+Zamiell@users.noreply.github.com> Date: Thu, 23 Jun 2022 20:29:52 -0400 Subject: [PATCH 04/11] no more eval --- src/lib/converter/symbols.ts | 71 +++++++++++++++++------------------- 1 file changed, 33 insertions(+), 38 deletions(-) diff --git a/src/lib/converter/symbols.ts b/src/lib/converter/symbols.ts index af47ec62a..aa791a073 100644 --- a/src/lib/converter/symbols.ts +++ b/src/lib/converter/symbols.ts @@ -879,6 +879,20 @@ function isValidEnumProperty(type: ts.Type) { ); } +function isNumberLike(type: ts.Type) { + return hasAnyFlag( + type.flags, + ts.TypeFlags.NumberLike + ); +} + +function isStringLike(type: ts.Type) { + return hasAnyFlag( + type.flags, + ts.TypeFlags.StringLike + ); +} + function convertVariableAsEnum( context: Context, symbol: ts.Symbol, @@ -902,13 +916,27 @@ function convertVariableAsEnum( void 0 ); - const enumMemberValue = getEnumMemberValue(context, declaration, prop); - if ( - typeof enumMemberValue === "string" || - typeof enumMemberValue === "number" - ) { + const propType = context.checker.getTypeOfSymbolAtLocation( + prop, + declaration + ); + + if (propType.isStringLiteral() || propType.isNumberLiteral()) { + // The trivial case is a string or number literal. + const enumMemberValue = propType.value; reflection.defaultValue = JSON.stringify(enumMemberValue); reflection.type = new LiteralType(enumMemberValue); + } else { + // If this is not a string or number literal, this it is probably an expression, like + // "1 << 1". We cannot safely evaluate the code to find out the value, so revert to + // printing "number" or "string", similar to what TypeScript itself does. + if (isNumberLike(propType)) { + reflection.type = new IntrinsicType("number"); + } else if (isStringLike(propType)) { + reflection.type = new IntrinsicType ("string"); + } else { + reflection.type = new IntrinsicType ("unknown"); + } } rc.finalizeDeclarationReflection(reflection, prop, void 0); @@ -918,39 +946,6 @@ function convertVariableAsEnum( return ts.SymbolFlags.TypeAlias; } -function getEnumMemberValue( - context: Context, - declaration: ts.VariableDeclaration, - prop: ts.Symbol -): unknown | undefined { - const propType = context.checker.getTypeOfSymbolAtLocation( - prop, - declaration - ); - - // The trivial case is a string or number literal. - if (propType.isStringLiteral() || propType.isNumberLiteral()) { - return propType.value; - } - - // Handle expressions that resolve to a string or number value. - const propDeclarations = prop.getDeclarations(); - if (propDeclarations === undefined) { - return undefined; - } - - const firstPropDeclaration = propDeclarations[0]; - if ( - firstPropDeclaration === undefined || - !ts.isPropertyAssignment(firstPropDeclaration) - ) { - return undefined; - } - - const propCode = firstPropDeclaration.initializer.getText(); - return eval(propCode); -} - function convertVariableAsFunction( context: Context, symbol: ts.Symbol, From 3745f9a01bfa06faab556b78fe0e20032d1f4c3f Mon Sep 17 00:00:00 2001 From: James <5511220+Zamiell@users.noreply.github.com> Date: Thu, 23 Jun 2022 22:08:17 -0400 Subject: [PATCH 05/11] updating spec --- src/test/converter/js/specs.json | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/test/converter/js/specs.json b/src/test/converter/js/specs.json index 1c2e4aed6..792d270b9 100644 --- a/src/test/converter/js/specs.json +++ b/src/test/converter/js/specs.json @@ -99,10 +99,9 @@ "kindString": "Enumeration Member", "flags": {}, "type": { - "type": "literal", - "value": "number" - }, - "defaultValue": "\"number\"" + "type": "intrinsic", + "name": "string" + } }, { "id": 11, @@ -111,10 +110,9 @@ "kindString": "Enumeration Member", "flags": {}, "type": { - "type": "literal", - "value": "string" - }, - "defaultValue": "\"string\"" + "type": "intrinsic", + "name": "string" + } } ], "groups": [ From d700fffd7a6af09f863d5690ce298b5e3023df13 Mon Sep 17 00:00:00 2001 From: James <5511220+Zamiell@users.noreply.github.com> Date: Thu, 23 Jun 2022 22:13:11 -0400 Subject: [PATCH 06/11] prettier --- src/lib/converter/symbols.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/lib/converter/symbols.ts b/src/lib/converter/symbols.ts index aa791a073..8806083ca 100644 --- a/src/lib/converter/symbols.ts +++ b/src/lib/converter/symbols.ts @@ -880,17 +880,11 @@ function isValidEnumProperty(type: ts.Type) { } function isNumberLike(type: ts.Type) { - return hasAnyFlag( - type.flags, - ts.TypeFlags.NumberLike - ); + return hasAnyFlag(type.flags, ts.TypeFlags.NumberLike); } function isStringLike(type: ts.Type) { - return hasAnyFlag( - type.flags, - ts.TypeFlags.StringLike - ); + return hasAnyFlag(type.flags, ts.TypeFlags.StringLike); } function convertVariableAsEnum( @@ -933,9 +927,9 @@ function convertVariableAsEnum( if (isNumberLike(propType)) { reflection.type = new IntrinsicType("number"); } else if (isStringLike(propType)) { - reflection.type = new IntrinsicType ("string"); + reflection.type = new IntrinsicType("string"); } else { - reflection.type = new IntrinsicType ("unknown"); + reflection.type = new IntrinsicType("unknown"); } } From a8d98646b1e52712c618c03bd43be27720d8dc4b Mon Sep 17 00:00:00 2001 From: James <5511220+Zamiell@users.noreply.github.com> Date: Fri, 24 Jun 2022 13:10:53 -0400 Subject: [PATCH 07/11] adding tests --- src/test/behaviorTests.ts | 7 +++++++ src/test/converter2/behavior/asConstEnum.ts | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/test/behaviorTests.ts b/src/test/behaviorTests.ts index 2ad7ae0e6..62e7195a4 100644 --- a/src/test/behaviorTests.ts +++ b/src/test/behaviorTests.ts @@ -80,6 +80,13 @@ export const behaviorTests: Record< ReflectionKind.Enum, "WithoutReadonlyNumeric" ); + + const WithNumericExpression = query(project, "WithNumericExpression"); + equal( + WithNumericExpression.kind, + ReflectionKind.Enum, + "WithNumericExpression" + ); }, declareGlobal(project) { diff --git a/src/test/converter2/behavior/asConstEnum.ts b/src/test/converter2/behavior/asConstEnum.ts index 4cbaa156d..1e0a4d60c 100644 --- a/src/test/converter2/behavior/asConstEnum.ts +++ b/src/test/converter2/behavior/asConstEnum.ts @@ -53,3 +53,10 @@ export const ManualEnumHelperNumeric: Readonly<{ a: 0 }> = { export const WithoutReadonlyNumeric = { a: 0, } as { a: 0 }; + +/* Enum-like objects with numeric expression values */ + +/** @enum */ +export const WithNumericExpression = { + a: 1 << 0, +}; From 18a92286e3418bfae0a622f02daf90de7f10eebe Mon Sep 17 00:00:00 2001 From: James <5511220+Zamiell@users.noreply.github.com> Date: Fri, 24 Jun 2022 13:19:57 -0400 Subject: [PATCH 08/11] adding more tests --- src/test/behaviorTests.ts | 7 +++++++ src/test/converter2/behavior/asConstEnum.ts | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/test/behaviorTests.ts b/src/test/behaviorTests.ts index 62e7195a4..d5fbdd898 100644 --- a/src/test/behaviorTests.ts +++ b/src/test/behaviorTests.ts @@ -81,6 +81,13 @@ export const behaviorTests: Record< "WithoutReadonlyNumeric" ); + const WithInvalidTypeUnionMember = query(project, "WithInvalidTypeUnionMember"); + equal( + WithInvalidTypeUnionMember.kind, + ReflectionKind.Variable, + "WithInvalidTypeUnionMember" + ); + const WithNumericExpression = query(project, "WithNumericExpression"); equal( WithNumericExpression.kind, diff --git a/src/test/converter2/behavior/asConstEnum.ts b/src/test/converter2/behavior/asConstEnum.ts index 1e0a4d60c..8a79441eb 100644 --- a/src/test/converter2/behavior/asConstEnum.ts +++ b/src/test/converter2/behavior/asConstEnum.ts @@ -54,6 +54,13 @@ export const WithoutReadonlyNumeric = { a: 0, } as { a: 0 }; +/** @enum */ +export const WithInvalidTypeUnionMember = { + // Since this is an invalid type union, this should fail to convert to an enum, + // and be represented in the generated docs as a variable instead. + a: 0 as 0 | string, +}; + /* Enum-like objects with numeric expression values */ /** @enum */ From fdb4d83ef7e21b01fe782826000dd825d9a8e15c Mon Sep 17 00:00:00 2001 From: James <5511220+Zamiell@users.noreply.github.com> Date: Fri, 24 Jun 2022 18:33:40 -0400 Subject: [PATCH 09/11] Update src/lib/converter/symbols.ts Co-authored-by: Gerrit Birkeland --- src/lib/converter/symbols.ts | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/lib/converter/symbols.ts b/src/lib/converter/symbols.ts index 8806083ca..d8a927dcf 100644 --- a/src/lib/converter/symbols.ts +++ b/src/lib/converter/symbols.ts @@ -915,22 +915,10 @@ function convertVariableAsEnum( declaration ); + reflection.type = context.converter.convertType(context, propType); + if (propType.isStringLiteral() || propType.isNumberLiteral()) { - // The trivial case is a string or number literal. - const enumMemberValue = propType.value; - reflection.defaultValue = JSON.stringify(enumMemberValue); - reflection.type = new LiteralType(enumMemberValue); - } else { - // If this is not a string or number literal, this it is probably an expression, like - // "1 << 1". We cannot safely evaluate the code to find out the value, so revert to - // printing "number" or "string", similar to what TypeScript itself does. - if (isNumberLike(propType)) { - reflection.type = new IntrinsicType("number"); - } else if (isStringLike(propType)) { - reflection.type = new IntrinsicType("string"); - } else { - reflection.type = new IntrinsicType("unknown"); - } + reflection.defaultValue = JSON.stringify(propType.value); } rc.finalizeDeclarationReflection(reflection, prop, void 0); From 97ca7816340a7fa1115dfaaeee8e4526954e06e6 Mon Sep 17 00:00:00 2001 From: James <5511220+Zamiell@users.noreply.github.com> Date: Fri, 24 Jun 2022 18:36:34 -0400 Subject: [PATCH 10/11] remove dead code --- src/lib/converter/symbols.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/lib/converter/symbols.ts b/src/lib/converter/symbols.ts index d8a927dcf..24d4ecb2c 100644 --- a/src/lib/converter/symbols.ts +++ b/src/lib/converter/symbols.ts @@ -879,14 +879,6 @@ function isValidEnumProperty(type: ts.Type) { ); } -function isNumberLike(type: ts.Type) { - return hasAnyFlag(type.flags, ts.TypeFlags.NumberLike); -} - -function isStringLike(type: ts.Type) { - return hasAnyFlag(type.flags, ts.TypeFlags.StringLike); -} - function convertVariableAsEnum( context: Context, symbol: ts.Symbol, From 740be48c0b164c847b57bb76aad6f91d9a22c528 Mon Sep 17 00:00:00 2001 From: James <5511220+Zamiell@users.noreply.github.com> Date: Fri, 24 Jun 2022 18:41:31 -0400 Subject: [PATCH 11/11] prettier --- src/test/behaviorTests.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/test/behaviorTests.ts b/src/test/behaviorTests.ts index d5fbdd898..bc005bffe 100644 --- a/src/test/behaviorTests.ts +++ b/src/test/behaviorTests.ts @@ -81,7 +81,10 @@ export const behaviorTests: Record< "WithoutReadonlyNumeric" ); - const WithInvalidTypeUnionMember = query(project, "WithInvalidTypeUnionMember"); + const WithInvalidTypeUnionMember = query( + project, + "WithInvalidTypeUnionMember" + ); equal( WithInvalidTypeUnionMember.kind, ReflectionKind.Variable,