i am using top-level await in my nodejs module
You can use the
awaitkeyword on its own (outside of an async function) within a JavaScript module.
Files ending with
.jsare loaded as ES modules when the nearest parentpackage.jsonfile contains a top-level field"type"with a value of"module"
$ jq -r '.type' package.json
module
$ node --version
v16.14.2
$ npm --version
8.7.0
$ jq -r '.devDependencies.eslint' package.json
8.12.0
when i run eslint, which should have a support for top-level await, i get the error
Parsing error: Cannot use keyword 'await' outside an async function
how do i make eslint honor top-level await?