Can anyone help me understand why the
@typescript-eslint/no-floating-promises
rule works with some async functions but not all?
To my understanding, these two functions should be equivalent:
const getUser = async (userId: string): Promise<User> => {
const userRef = await getUsersCollection().doc(userId).get()
return userRef.data()
}
async function getUser2(userId: string) {
const userRef = await getUsersCollection().doc(userId).get()
return userRef.data()
}
However, I noticed that when running npm lint
or checking my code in VS Code, only one call triggers the no floating promises
error. Why is this happening?