eslint-plugin-es icon indicating copy to clipboard operation
eslint-plugin-es copied to clipboard

New Rule Proposal: `no-top-level-await`

Open ota-meshi opened this issue 3 years ago • 0 comments

Please describe what the rule should do:

Disallows Top-level await added in ES2022.

https://github.com/tc39/proposal-top-level-await

Provide 2-3 code examples that this rule will warn about:

const strings = await import(`/i18n/${navigator.language}`);

const connection = await dbConnector();

let jQuery;
try {
  jQuery = await import('https://cdn-a.com/jQuery');
} catch {
  jQuery = await import('https://cdn-b.com/jQuery');
}

ota-meshi avatar May 31 '21 06:05 ota-meshi