diff --git a/.eslintrc.json b/.eslintrc.json index 9d14f1d7..f92423cb 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,6 +1,6 @@ { "parserOptions": { - "ecmaVersion": 2021, + "ecmaVersion": 2022, "ecmaFeatures": { "jsx": true }, diff --git a/package.json b/package.json index a4679847..80e0822a 100644 --- a/package.json +++ b/package.json @@ -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": [ diff --git a/test/validate-config.js b/test/validate-config.js index 090d1a5b..34b6a431 100644 --- a/test/validate-config.js +++ b/test/validate-config.js @@ -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() +})