Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow top-level await support #212

Merged
merged 2 commits into from Jan 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.json
@@ -1,6 +1,6 @@
{
"parserOptions": {
"ecmaVersion": 2021,
"ecmaVersion": 2022,
"ecmaFeatures": {
"jsx": true
},
Expand Down
6 changes: 4 additions & 2 deletions package.json
Expand Up @@ -11,11 +11,13 @@
"url": "https://github.com/standard/eslint-config-standard/issues"
},
"devDependencies": {
"eslint": "^8.6.0",
"@types/eslint": "^8.4.1",
"@types/tape": "^4.13.2",
"eslint": "^8.8.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-n": "^14.0.0",
"eslint-plugin-promise": "^6.0.0",
"tape": "^5.4.0"
"tape": "^5.5.0"
},
"homepage": "https://github.com/standard/eslint-config-standard",
"keywords": [
Expand Down
8 changes: 8 additions & 0 deletions test/validate-config.js
Expand Up @@ -8,3 +8,11 @@ test('load config in eslint to validate all rule syntax is correct', async funct
t.equal(lintResult.errorCount, 0)
t.end()
})

test('ensure we allow top level await', async function (t) {
const eslint = new ESLint()
const code = 'const foo = await 1\nconst bar = function () {}\nawait bar(foo)\n'
const [lintResult] = await eslint.lintText(code)
t.equal(lintResult.errorCount, 0)
t.end()
})