Skip to content

Commit

Permalink
fix: allow top-level await support (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
voxpelli committed Jan 31, 2022
1 parent 3bc8b18 commit f364e98
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
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()
})

0 comments on commit f364e98

Please sign in to comment.