fix: add eslint-plugin-sonarjs and rules (#2767)

This commit is contained in:
LongYinan authored and GitHub committed 2023-06-14 10:45:14 +08:00
1 parent 1c8f1a05d0
commit 3996955e3b
8 files changed
+50 -35

No files matched your search

+6 -4
View File
@@ -207,10 +207,12 @@ export function createAffineAuth(prefix = '/') {
}),
}).then(r => r.json()) as Promise<LoginResponse>;
} catch (error) {
if (error instanceof Error && 'code' in error) {
if (error.code === 'auth/popup-closed-by-user') {
return null;
}
if (
error instanceof Error &&
'code' in error &&
error.code === 'auth/popup-closed-by-user'
) {
return null;
}
logger.error('Failed to sign in', error);
}