no-top-level-await
不允许使用顶级 await 表达式。
在通过 dnt 分发 CommonJS/UMD 时,无法使用顶级 await。
无效示例:
await foo();
for await (item of items) {}
有效示例:
async function foo() {
await task();
}
async function bar() {
for await (item of items) {}
}
不允许使用顶级 await 表达式。
在通过 dnt 分发 CommonJS/UMD 时,无法使用顶级 await。
无效示例:
await foo();
for await (item of items) {}
有效示例:
async function foo() {
await task();
}
async function bar() {
for await (item of items) {}
}