In my standard, all types annotations where possible are required, so TypeScrit-ESLint tells me to annotate the [ responseData, cognitoUser ]
. However, the syntax [ responseData1: ResponseData1, responseData2: ResponseData2]
is invalid (TS1005: ';' expected
). If there is no such syntax, it's the issue in TypeScript/ESLint repository.
let responseData1: ResponseData1;
let responseData2: ResponseData2;
try {
[ responseData1, responseData2] = await Promise.all([ /* ... */ ])
} catch {
// ...
}
From TS 4 you can add labels for array types.
And you can use it for your Promise.all: