In the current TypeScript environment, I am able to write code like this:
async function getSomething():Promise<Something> {
// ...
}
And later in my code:
const myObject = getSomething();
However, when I attempt to use myObject
at a later point, it results in strange errors.
I'm curious if there is a way for TypeScript to show an error when a promise is obtained without using await
. I've searched for a flag to enable this behavior but have not been successful. Perhaps I overlooked something.