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 authored 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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parserOptions": {
"ecmaVersion": 2021,
"ecmaVersion": 2022,
"ecmaFeatures": {
"jsx": true
},
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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.