Closed
Description
Often, I accidentally type 'await' instead of 'async' for my async arrow functions:
function g() {
f(await () => {
await x;
});
}
quick-lint-js reports errors for both await(
and await x
:
hello.js:3:5: error: 'await' is only allowed in async functions [E162]
hello.js:2:5: error: missing operator between expression and arrow function [E063]
hello.js:2:5: warning: use of undeclared variable: await [E057]
quick-lint-js should infer that async
was intended, and provide a better error message (see below) and better error recovery (by assuming that the arrow function is async
):
hello.js:2:5: error: 'await' does not create an async arrow function; use 'async' instead [E???]