The following block of code throws two warnings
- ESLint: Promise executor functions should not be async.
(no-async-promise-executor) - ESLint: Promise returned in function argument where a void return was expected.
(@typescript-eslint/no-misused-promises)
What is the best way of rewriting it to get rid of the error messages?
async signIn(email: string, password: string, redirectTo: string): Promise<unknown> {
return new Promise(async (resolve, reject) => {
const { error, data } = await this.supabaseClient.auth.signIn(
{ email: email, password: password },
{ redirectTo: redirectTo }
);
if (error) {
reject(error);
} else {
resolve(data);
}
});
}