Enable noImplicitReturns

This commit is contained in:
Manav Rathi 2024-05-24 19:31:08 +05:30
parent 82bffd81de
commit b9fe509567
No known key found for this signature in database
5 changed files with 10 additions and 2 deletions

View file

@ -14,7 +14,7 @@
"strict": false,
/* Stricter than strict */
"noImplicitReturns": false,
"noImplicitReturns": true,
"noUnusedParameters": false,
"noUnusedLocals": false,
"noFallthroughCasesInSwitch": false,

View file

@ -168,7 +168,7 @@ export default function Credentials({ appContext, appName }: PageProps) {
window.location.href = `${getAccountsURL()}/passkeys/flow?passkeySessionID=${passkeySessionID}&redirect=${
window.location.origin
}/passkeys/finish`;
return;
return undefined;
} else if (twoFactorSessionID) {
const sessionKeyAttributes =
await cryptoWorker.generateKeyAndEncryptToB64(kek);

View file

@ -308,6 +308,7 @@ export async function deriveSensitiveKey(passphrase: string, salt: string) {
memLimit /= 2;
}
}
throw new Error("Failed to derive key: Memory limit exceeded");
}
export async function deriveInteractiveKey(passphrase: string, salt: string) {

View file

@ -216,4 +216,5 @@ function getIconColor(ownerState, colors: ThemeColorsOptions) {
color: colors.stroke.faint,
};
}
return {};
}

View file

@ -26,6 +26,12 @@ export function isPromise<T>(obj: T | Promise<T>): obj is Promise<T> {
export async function retryAsyncFunction<T>(
request: (abort?: () => void) => Promise<T>,
waitTimeBeforeNextTry?: number[],
// Need to use @ts-ignore since this same file is currently included with
// varying tsconfigs, and the error is only surfaced in the stricter ones of
// them.
//
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TSC fails to detect that the exit of the loop is unreachable
): Promise<T> {
if (!waitTimeBeforeNextTry) waitTimeBeforeNextTry = [2000, 5000, 10000];