From 4fd1b934a568741477715166f2c0aee57996aa0b Mon Sep 17 00:00:00 2001 From: Lars Johansson Date: Mon, 18 Dec 2023 12:50:12 +0100 Subject: [PATCH] chore: linting changes --- .yarnrc.yml | 2 +- source/emit.test.ts | 16 +++++++++------- source/emit.ts | 6 +++--- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.yarnrc.yml b/.yarnrc.yml index ef29fa9..c6483e2 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -5,4 +5,4 @@ plugins: spec: "@yarnpkg/plugin-interactive-tools" yarnPath: .yarn/releases/yarn-3.5.0.cjs -nodeLinker: node-modules \ No newline at end of file +nodeLinker: node-modules diff --git a/source/emit.test.ts b/source/emit.test.ts index a270b79..eb59bb8 100644 --- a/source/emit.test.ts +++ b/source/emit.test.ts @@ -322,9 +322,7 @@ test("default object types", async () => { const contents = await readFile( join(".", "source", "__snapshots__", "responses", "query_object_types.json") ); - const objectTypes: ObjectType[] = JSON.parse( - contents.toString() - ); + const objectTypes: ObjectType[] = JSON.parse(contents.toString()); //act const emitResult = await emitToString( @@ -347,7 +345,13 @@ test("default object types", async () => { test("default highway test (all values specified)", async () => { //arrange const schemasContents = await readFile( - join(".", "source", "__snapshots__", "responses", "query_project_schema.json") + join( + ".", + "source", + "__snapshots__", + "responses", + "query_project_schema.json" + ) ); const schemas: Array = JSON.parse(schemasContents.toString()); @@ -372,9 +376,7 @@ test("default highway test (all values specified)", async () => { const objectTypeContents = await readFile( join(".", "source", "__snapshots__", "responses", "query_object_types.json") ); - const objectTypes: ObjectType[] = JSON.parse( - objectTypeContents.toString() - ); + const objectTypes: ObjectType[] = JSON.parse(objectTypeContents.toString()); //act const emitResult = await emitToString( diff --git a/source/emit.ts b/source/emit.ts index e164b1c..41e47eb 100644 --- a/source/emit.ts +++ b/source/emit.ts @@ -204,9 +204,9 @@ export async function emitToString( name: "${x.name}", objectTypes: [ ${x.object_types - .map(t => objectTypes.find(x => x.id === t.id)) - .map(t => `"${t!.name}"`) - .join(', ')} + .map((t) => objectTypes.find((x) => x.id === t.id)) + .map((t) => `"${t?.name}"`) + .join(", ")} ] }` )}