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 Support for Top-level await #14632
Comments
For reference, the relevant comment in the tc39 proposal. |
(The canonical source of truth is here: tc39/proposals@99fa42a) |
Thanks for opening this. We can definitely start implanting it and would love some help to get started. |
I opened a pull request in acorn. |
Related (but old and outdated) #13178 |
What is the status of this feature, I want to use eslint with my project and want a way to wave of the error?
Question: what version of ecma does top-level await joins in? |
Probably blocked by #14591? |
Yup. Support will be released in v8.0.0. We are finishing up that work now. |
Do you have an idea of the release date ? |
Nothing firm. We will likely release a beta within the next two weeks and the final version will depend on the feedback we get during the beta. |
Happy afternoon (or morning)! Will this fix |
@joshunger it should. Be sure you have ecmaVersion set to 2022 and sourceType set to module. If you’re still having trouble, please stop by the chat. |
@nzakas thanks for the help I missed the |
Hi! > eslint . --ext .mjs --fix
Oops! Something went wrong! :(
ESLint: 8.0.0-beta.1
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/util/glob-util' is not defined by "exports" in /Users/andreisoroka/git/other/faststartservice/node_modules/eslint/package.json
at throwExportsNotFound (internal/modules/esm/resolve.js:285:9)
at packageExportsResolve (internal/modules/esm/resolve.js:508:3)
at resolveExports (internal/modules/cjs/loader.js:450:36)
at Function.Module._findPath (internal/modules/cjs/loader.js:490:31)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:888:27)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (/Users/andreisoroka/git/other/faststartservice/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
at Object.<anonymous> (/Users/andreisoroka/git/other/faststartservice/node_modules/eslint-plugin-import/lib/rules/no-unused-modules.js:43:34)
at Module._compile (/Users/andreisoroka/git/other/faststartservice/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! fuststartservice@0.0.0 lint:fix: `eslint . --ext .mjs --fix`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the fuststartservice@0.0.0 lint:fix script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above. package.json {
"scripts": {
"lint": "eslint . --ext .mjs",
"lint:fix": "eslint . --ext .mjs --fix"
},
"devDependencies": {
// "eslint": "^7.32.0", // was
"eslint": "^8.0.0-beta.1",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-plugin-import": "^2.24.2"
}
} {
"env": {
// "es2021": true, (and with 2021 don't work)
"es2022": true,
"node": true
},
"extends": [
"airbnb-base"
],
"parserOptions": {
// "ecmaVersion": 12, // was
"ecmaVersion": 2022,
"sourceType": "module"
},
"settings": {
"import/resolver": {
"node": {
"extensions": [
".js",
".mjs"
]
}
}
},
"rules": {
"no-console": "off",
"no-underscore-dangle": "off",
"import/extensions": [
"error",
"always"
]
}
} |
Hi @AndreiSoroka!
This is a problem in Can you please report this problem to https://github.com/import-js/eslint-plugin-import ? Thanks for testing ESLint prereleases and let us know if you find any other problems! Just please open separate issue(s) so we could track them, this one is only about adding support for top-level await. |
Thanks! I check issues and find import-js/eslint-plugin-import#2211 |
FYI: @ljharb |
I’m aware; most of the ecosystem doesn’t support eslint 8 yet, which is fine since it’s not actually out yet. |
Please open new issues if you find problems with ESLint 8 functionality. |
Today Top-level await reached Stage 4.
This brings new depth to async modules, and I'm looking forward to seeing it implemented in ESLint in the near future.
allowAwaitOutsideFunction
to be enabled by default whenecmaVersion
>= 2022 acornjs/acorn#1040eslint-visitor-keys
espree
update: Update: Support top-level await and regexp match indices espree#505eslint-scope
update:eslint
update:The text was updated successfully, but these errors were encountered: