Commit 911f880
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.ts1 parent beded4b commit 911f880
File tree
1 file changed
+3
-3
lines changed- extensions/ql-vscode/src/language-support/ast-viewer
1 file changed
+3
-3
lines changedLines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
38 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
0 commit comments