Open
Description
Rule details
It would warn about using top-level awaits as it conflicts with require(esm)
.
Unfortunately no-restricted-syntax
cannot be used as the following should be ignored:
- files with a shebang or without exports
- files called from
package.json
scripts
What type of rule is this?
Warns about a potential problem
Example code
await fn();
for await (const x of asyncGenerator()) {
}
Participation
- I am willing to submit a pull request to implement this rule.
Additional comments
This rule was discussed in the eslint repo but declined with a reference to open here.