diff --git a/docs/docs/actions/triggers.md b/docs/docs/actions/triggers.md index edb6e20a8..170d4030e 100644 --- a/docs/docs/actions/triggers.md +++ b/docs/docs/actions/triggers.md @@ -133,7 +133,7 @@ export default class CreateEventAction extends CreateEventActionBase { if (!this.input.address) { return; } - return await CreateAddressAction.create(builder.viewer, { + return CreateAddressAction.create(builder.viewer, { ...this.input.address, ownerID: builder, ownerType: NodeType.Event, diff --git a/ts/src/action/action.test.ts b/ts/src/action/action.test.ts index 7e2d48a3f..e6d64b5f8 100644 --- a/ts/src/action/action.test.ts +++ b/ts/src/action/action.test.ts @@ -225,7 +225,7 @@ function getUserEditBuilder( async function createUser(): Promise { const builder = getUserCreateBuilder(); await builder.saveX(); - return await builder.editedEntX(); + return builder.editedEntX(); } async function createEdgeRows(edges: string[]) { diff --git a/ts/src/action/executor.test.ts b/ts/src/action/executor.test.ts index 5ae472a2c..8ebe36a29 100644 --- a/ts/src/action/executor.test.ts +++ b/ts/src/action/executor.test.ts @@ -752,9 +752,8 @@ function commonTests() { async function doNothing(): Promise {} action.getTriggers = () => [ { - changeset: async () => { - return await Promise.all([userAction.changeset(), doNothing()]); - }, + changeset: async () => + Promise.all([userAction.changeset(), doNothing()]), }, ]; diff --git a/ts/src/action/experimental_action.ts b/ts/src/action/experimental_action.ts index d334c4ef4..d1a171618 100644 --- a/ts/src/action/experimental_action.ts +++ b/ts/src/action/experimental_action.ts @@ -164,12 +164,12 @@ export class BaseAction< async save(): Promise { await this.builder.save(); - return await this.builder.editedEnt(); + return this.builder.editedEnt(); } async saveX(): Promise { await this.builder.saveX(); - return await this.builder.editedEntX(); + return this.builder.editedEntX(); } getInput() { diff --git a/ts/src/core/db.ts b/ts/src/core/db.ts index 04e2a9530..c077cc0f8 100644 --- a/ts/src/core/db.ts +++ b/ts/src/core/db.ts @@ -461,7 +461,7 @@ export class Postgres implements Connection { } async close() { - return await this.pool.end(); + return this.pool.end(); } } diff --git a/ts/src/core/ent.test.ts b/ts/src/core/ent.test.ts index 277bd48d7..50d4302cb 100644 --- a/ts/src/core/ent.test.ts +++ b/ts/src/core/ent.test.ts @@ -77,7 +77,7 @@ function getUserEditBuilder( async function createUser(): Promise { const builder = getUserCreateBuilder(); await builder.saveX(); - return await builder.editedEntX(); + return builder.editedEntX(); } async function createEdgeRows(edges: string[], table?: string) { diff --git a/ts/src/core/ent.ts b/ts/src/core/ent.ts index e56e285b6..49e5e5377 100644 --- a/ts/src/core/ent.ts +++ b/ts/src/core/ent.ts @@ -419,7 +419,7 @@ export async function loadEntXFromClause< context: viewer.context, }; const row = await loadRowX(rowOptions); - return await applyPrivacyPolicyForRowX(viewer, options, row); + return applyPrivacyPolicyForRowX(viewer, options, row); } export async function loadEnts< @@ -709,7 +709,7 @@ export async function loadDerivedEntX< loader: new (viewer: TViewer, data: Data) => TEnt, ): Promise { const ent = new loader(viewer, data); - return await applyPrivacyPolicyForEntX(viewer, ent, data, { ent: loader }); + return applyPrivacyPolicyForEntX(viewer, ent, data, { ent: loader }); } interface FieldPrivacyOptions< @@ -1505,7 +1505,7 @@ export async function loadUniqueNode< if (!edge) { return null; } - return await loadEnt(viewer, edge.id2, options); + return loadEnt(viewer, edge.id2, options); } export async function loadRawEdgeCountX( @@ -1608,7 +1608,7 @@ async function applyPrivacyPolicyForRowX< row: Data, ): Promise { const ent = new options.ent(viewer, row); - return await applyPrivacyPolicyForEntX(viewer, ent, row, options); + return applyPrivacyPolicyForEntX(viewer, ent, row, options); } // deprecated. doesn't use entcache diff --git a/ts/src/core/ent_data.test.ts b/ts/src/core/ent_data.test.ts index 52f71efb4..8d6b06286 100644 --- a/ts/src/core/ent_data.test.ts +++ b/ts/src/core/ent_data.test.ts @@ -1078,7 +1078,7 @@ function commonTests() { }; const testEnt = async (vc: Viewer) => { - return await loadTestEnt( + return loadTestEnt( () => ent.loadEntX(vc, 1, User.loaderOptions()), () => { const qOption = { diff --git a/ts/src/core/loaders/assoc_count_loader.ts b/ts/src/core/loaders/assoc_count_loader.ts index 81e933fb3..f2b1356cd 100644 --- a/ts/src/core/loaders/assoc_count_loader.ts +++ b/ts/src/core/loaders/assoc_count_loader.ts @@ -59,7 +59,7 @@ export class AssocEdgeCountLoader implements Loader { }); } const loader = await this.loaderFn(); - return await loader.load(id); + return loader.load(id); } clearAll() { diff --git a/ts/src/core/loaders/query_loader.test.ts b/ts/src/core/loaders/query_loader.test.ts index 0233bfcc8..a6b08d2ab 100644 --- a/ts/src/core/loaders/query_loader.test.ts +++ b/ts/src/core/loaders/query_loader.test.ts @@ -336,7 +336,7 @@ function commonTests() { ids.map(async (id) => { // have to use different loader for each to get results const loader = getNonGroupableLoader(id); - return await loader.load(id); + return loader.load(id); }), ); ml.verifyNoErrors(); diff --git a/ts/src/core/loaders/raw_count_loader.ts b/ts/src/core/loaders/raw_count_loader.ts index 6b1de396c..894bafb31 100644 --- a/ts/src/core/loaders/raw_count_loader.ts +++ b/ts/src/core/loaders/raw_count_loader.ts @@ -122,7 +122,7 @@ export class RawCountLoader implements Loader { async load(id: K): Promise { if (this.loader) { - return await this.loader.load(id); + return this.loader.load(id); } const rows = await simpleCase(this.options, id, this.context); diff --git a/ts/src/core/query/query.ts b/ts/src/core/query/query.ts index 984092a20..e3e0ec6cb 100644 --- a/ts/src/core/query/query.ts +++ b/ts/src/core/query/query.ts @@ -464,7 +464,7 @@ export abstract class BaseEdgeQuery< // this is basically just raw rows readonly queryEdges = async (): Promise => { - return await this.querySingleEdge("queryEdges"); + return this.querySingleEdge("queryEdges"); }; abstract queryRawCount(): Promise; diff --git a/ts/src/core/query/shared_assoc_test.ts b/ts/src/core/query/shared_assoc_test.ts index c09e7bf4e..a5f6e0b2c 100644 --- a/ts/src/core/query/shared_assoc_test.ts +++ b/ts/src/core/query/shared_assoc_test.ts @@ -464,7 +464,7 @@ export function assocTests(ml: MockLogs, global = false) { ); } await builder.saveX(); - return await builder.editedEntX(); + return builder.editedEntX(); }), ); diff --git a/ts/src/graphql/query/edge_connection.ts b/ts/src/graphql/query/edge_connection.ts index e5aefa737..2e0bc487b 100644 --- a/ts/src/graphql/query/edge_connection.ts +++ b/ts/src/graphql/query/edge_connection.ts @@ -103,7 +103,7 @@ export class GraphQLEdgeConnection< } async queryTotalCount() { - return await this.query.queryRawCount(); + return this.query.queryRawCount(); } async queryEdges() { @@ -116,7 +116,7 @@ export class GraphQLEdgeConnection< // if nodes queried just return ents // unlikely to query nodes and pageInfo so we just load this separately for now async queryNodes() { - return await this.query.queryEnts(); + return this.query.queryEnts(); } private defaultPageInfo() { diff --git a/ts/src/graphql/tests/file_upload.test.ts b/ts/src/graphql/tests/file_upload.test.ts index 2f535b92a..cc8f2d92e 100644 --- a/ts/src/graphql/tests/file_upload.test.ts +++ b/ts/src/graphql/tests/file_upload.test.ts @@ -28,7 +28,7 @@ afterAll(() => { }); async function readStream(file): Promise { - return await new Promise((resolve) => { + return new Promise((resolve) => { const stream = file.createReadStream(); let data: string[] = []; stream.on("data", function (chunk) { diff --git a/ts/src/scripts/custom_graphql.ts b/ts/src/scripts/custom_graphql.ts index ea4edc68a..9db386445 100644 --- a/ts/src/scripts/custom_graphql.ts +++ b/ts/src/scripts/custom_graphql.ts @@ -38,7 +38,7 @@ async function readInputs(): Promise<{ nodes: string[]; nodesMap: Map; }> { - return await new Promise((resolve) => { + return new Promise((resolve) => { const rl = readline.createInterface({ input: process.stdin, // output: process.stdout, diff --git a/ts/src/testutils/builder.ts b/ts/src/testutils/builder.ts index 93322fb8b..cf393fa9d 100644 --- a/ts/src/testutils/builder.ts +++ b/ts/src/testutils/builder.ts @@ -298,11 +298,11 @@ export class SimpleBuilder< } async editedEnt(): Promise { - return await this.orchestrator.editedEnt(); + return this.orchestrator.editedEnt(); } async editedEntX(): Promise { - return await this.orchestrator.editedEntX(); + return this.orchestrator.editedEntX(); } async save(): Promise { @@ -314,11 +314,11 @@ export class SimpleBuilder< } async valid(): Promise { - return await this.orchestrator.valid(); + return this.orchestrator.valid(); } async validX(): Promise { - return await this.orchestrator.validX(); + return this.orchestrator.validX(); } } diff --git a/ts/src/testutils/db_mock.test.ts b/ts/src/testutils/db_mock.test.ts index 19f71b000..05f57d115 100644 --- a/ts/src/testutils/db_mock.test.ts +++ b/ts/src/testutils/db_mock.test.ts @@ -567,7 +567,7 @@ describe("ops", () => { test("AND 2 ops", async () => { await Promise.all( [4, 8].map(async (id) => { - return await editRowForTest({ + return editRowForTest({ tableName: "t", fields: { bar: "bar2", @@ -594,7 +594,7 @@ describe("ops", () => { test("AND 3 ops", async () => { await Promise.all( [4, 8].map(async (id) => { - return await editRowForTest({ + return editRowForTest({ tableName: "t", fields: { bar: "bar2", @@ -650,7 +650,7 @@ describe("ops", () => { test("OR 4 ops", async () => { await Promise.all( [4, 8].map(async (id) => { - return await editRowForTest({ + return editRowForTest({ tableName: "t", fields: { bar: "bar2", diff --git a/ts/src/testutils/ent-graphql-tests/index.ts b/ts/src/testutils/ent-graphql-tests/index.ts index dc7b2187b..895c7e0b9 100644 --- a/ts/src/testutils/ent-graphql-tests/index.ts +++ b/ts/src/testutils/ent-graphql-tests/index.ts @@ -345,7 +345,7 @@ export async function expectQueryFromRoot( config: queryRootConfig, ...options: Option[] // TODO queries? expected values ): Promise> { - return await expectFromRoot( + return expectFromRoot( { ...config, queryPrefix: "query", @@ -376,7 +376,7 @@ export async function expectMutation( }; } - return await expectFromRoot( + return expectFromRoot( { ...config, args: args, diff --git a/ts/src/testutils/fake_data/fake_contact.ts b/ts/src/testutils/fake_data/fake_contact.ts index d24582fbd..91b4a0808 100644 --- a/ts/src/testutils/fake_data/fake_contact.ts +++ b/ts/src/testutils/fake_data/fake_contact.ts @@ -140,7 +140,7 @@ export function getContactBuilder(viewer: Viewer, input: ContactCreateInput) { export async function createContact(viewer: Viewer, input: ContactCreateInput) { const builder = getContactBuilder(viewer, input); - return await builder.saveX(); + return builder.saveX(); } export const contactLoader = new ObjectLoaderFactory({ diff --git a/ts/src/testutils/fake_data/fake_event.ts b/ts/src/testutils/fake_data/fake_event.ts index 1f93394a7..a420bc97b 100644 --- a/ts/src/testutils/fake_data/fake_event.ts +++ b/ts/src/testutils/fake_data/fake_event.ts @@ -146,5 +146,5 @@ export function getEventBuilder(viewer: Viewer, input: EventCreateInput) { export async function createEvent(viewer: Viewer, input: EventCreateInput) { const builder = getEventBuilder(viewer, input); - return await builder.saveX(); + return builder.saveX(); } diff --git a/ts/src/testutils/fake_data/test_helpers.ts b/ts/src/testutils/fake_data/test_helpers.ts index 4c6d196b6..68f3f0fb3 100644 --- a/ts/src/testutils/fake_data/test_helpers.ts +++ b/ts/src/testutils/fake_data/test_helpers.ts @@ -156,7 +156,7 @@ export async function createAllContacts( }, ); await builder.saveX(); - return await builder.editedEntX(); + return builder.editedEntX(); }), ); expect(contacts.length).toBe(userInputs.length); @@ -325,7 +325,7 @@ export async function createTestEvent( builder.orchestrator.addOutboundEdge(user.id, EdgeType.EventToHosts, "User"); await builder.saveX(); - return await builder.editedEntX(); + return builder.editedEntX(); } export async function setupTempDB(global: boolean = false) { diff --git a/ts/src/testutils/fake_data/user_query.ts b/ts/src/testutils/fake_data/user_query.ts index d0936e19b..deb27f6b8 100644 --- a/ts/src/testutils/fake_data/user_query.ts +++ b/ts/src/testutils/fake_data/user_query.ts @@ -203,7 +203,7 @@ export class CustomEdge extends AssocEdge { } async loadUser(viewer: Viewer) { - return await FakeUser.load(viewer, this.id2); + return FakeUser.load(viewer, this.id2); } } diff --git a/ts/src/testutils/write.ts b/ts/src/testutils/write.ts index 0bf4875f5..579ae6df0 100644 --- a/ts/src/testutils/write.ts +++ b/ts/src/testutils/write.ts @@ -34,7 +34,7 @@ export async function createRowForTest( if (isSyncClient(client)) { return createRowSync(client, options, suffix || ""); } - return await createRow(client, options, suffix || ""); + return createRow(client, options, suffix || ""); } finally { client.release(); } @@ -47,7 +47,7 @@ export async function editRowForTest(options: EditRowOptions, suffix?: string) { if (isSyncClient(client)) { return editRowSync(client, options, suffix || ""); } - return await editRow(client, options, suffix); + return editRow(client, options, suffix); } finally { client.release(); } @@ -63,7 +63,7 @@ export async function deleteRowsForTest( if (isSyncClient(client)) { return deleteRowsSync(client, options, cls); } - return await deleteRows(client, options, cls); + return deleteRows(client, options, cls); } finally { client.release(); }