unicorn/no-await-expression-member Style ​
What it does ​
Disallows member access from await
expressions.
Why is this bad? ​
When accessing a member from an await
expression, the await
expression has to be parenthesized, which is not readable.
Example ​
javascript
async function bad() {
const secondElement = (await getArray())[1];
}
async function good() {
const [, secondElement] = await getArray();
}