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/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() +})