Skip to content

New Rule Proposal: no-top-level-await #69

@ota-meshi

Description

@ota-meshi

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');
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions