Skip to content

Commit 911f880

Browse files
committed
Fix redundant await in Promise.all in ast-builder
This commit removes redundant 'await' keywords inside a Promise.all() call that were causing ESLint errors. Problem: ESLint rule '@typescript-eslint/await-thenable' detected that the code was using 'await' on expressions that were already being passed to Promise.all(). This is redundant and incorrect: await Promise.all([ await this.cli.bqrsDecode(...), // ❌ redundant await await this.cli.bqrsDecode(...), // ❌ redundant await await this.cli.bqrsDecode(...), // ❌ redundant await ]); The 'await' inside the array causes each promise to be awaited sequentially before being added to the array, defeating the purpose of Promise.all() which is to run them in parallel. ESLint's stricter type checking (enabled by the Storybook 10 upgrade) now catches this. Solution: Remove the redundant 'await' keywords inside the Promise.all() array. The outer 'await Promise.all(...)' is sufficient: await Promise.all([ this.cli.bqrsDecode(...), // ✓ returns Promise this.cli.bqrsDecode(...), // ✓ returns Promise this.cli.bqrsDecode(...), // ✓ returns Promise ]); This fixes 3 ESLint errors: src/language-support/ast-viewer/ast-builder.ts:36:7 src/language-support/ast-viewer/ast-builder.ts:37:7 src/language-support/ast-viewer/ast-builder.ts:38:7 File modified: - extensions/ql-vscode/src/language-support/ast-viewer/ast-builder.ts
1 parent beded4b commit 911f880

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

extensions/ql-vscode/src/language-support/ast-viewer/ast-builder.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ export class AstBuilder {
3333
private async parseRoots(): Promise<AstItem[]> {
3434
const options = { entities: ["id", "url", "string"] };
3535
const [nodeTuples, edgeTuples, graphProperties] = await Promise.all([
36-
await this.cli.bqrsDecode(this.bqrsPath, "nodes", options),
37-
await this.cli.bqrsDecode(this.bqrsPath, "edges", options),
38-
await this.cli.bqrsDecode(this.bqrsPath, "graphProperties", options),
36+
this.cli.bqrsDecode(this.bqrsPath, "nodes", options),
37+
this.cli.bqrsDecode(this.bqrsPath, "edges", options),
38+
this.cli.bqrsDecode(this.bqrsPath, "graphProperties", options),
3939
]);
4040

4141
if (!this.isValidGraph(graphProperties)) {

0 commit comments

Comments
 (0)