If I have an asynchronous function foo = async function (){...}, I can find all files that call that function like so
grep -r 'foo' .
./f1: return await foo ();
./f2: return await foo ();
./f3: return foo ();
I can also find all the files that call it correctly through the use of the await command like so
grep -r 'await\s*foo' .
./f1: return await foo ();
./f2: return await foo ();
But how do I find the all the files that call it incorrectly without the use of the await command?
Note: Assume that I am only calling asynchronous functions through the await command and I don't use .then or capture the promise into a variable and call await on it later