-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking βSign up for GitHubβ, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add module: es2022
#44653
Comments
Yes please! π TS don't do a good job at figuring out if a file runs in a type module and have no understanding that top level await can be used or not. So i think it should just be enabled by default // index.js
var x = await Promise.resolve(0)
export default x I'm trying to solve this without a tsconfig in plain javascript But all i get is:
Is there some method to define that this file is executed as a esnext module somehow? |
@jimmywarting not yet, this will enable that by giving a stable target for your project. |
Thanks @saschanaz! |
Suggestion
π Search Terms
es2022
β Viability Checklist
My suggestion meets these guidelines:
β Suggestion
Add
module: es2022
and allow top level await in it.π Motivating Example
Top level await
π» Use Cases
Not being required to set esnext.
Related to #44571.
The text was updated successfully, but these errors were encountered: