eslint / eslint-plugin-markdown

Lint JavaScript code blocks in Markdown documents

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using 'await' outside 'async' functions

m-murasovs opened this issue · comments

commented

I have solitary code examples such as const foo = await bar(), which cause the Parsing error: Can not use keyword 'await' outside an async function

I cannot find a rule to disable this.

Any tips?

Thanks!

Top-level await is still a stage 3 experimental syntax proposal. ESLint will support it natively when it reaches stage 4 and becomes part of the language standard. Until then, we recommend using an external parser that supports this syntax, like @babel/eslint-parser. (You may also need @babel/plugin-syntax-top-level-await.)