mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-05 03:25:10 +08:00
fix: remove unused variables (#7968)
This commit is contained in:
@@ -83,7 +83,7 @@ export class AuthService implements OnApplicationBootstrap {
|
||||
await this.quota.switchUserQuota(devUser.id, QuotaType.ProPlanV1);
|
||||
await this.feature.addAdmin(devUser.id);
|
||||
await this.feature.addCopilot(devUser.id);
|
||||
} catch (e) {
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ export class QuotaService {
|
||||
...quota,
|
||||
feature: await QuotaConfig.get(this.prisma, quota.featureId),
|
||||
};
|
||||
} catch (_) {}
|
||||
} catch {}
|
||||
return null as unknown as typeof quota & {
|
||||
feature: QuotaConfig;
|
||||
};
|
||||
|
||||
@@ -21,7 +21,7 @@ export class DocID {
|
||||
static parse(raw: string): DocID | null {
|
||||
try {
|
||||
return new DocID(raw);
|
||||
} catch (e) {
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ export class WorkspacesController {
|
||||
let ts;
|
||||
try {
|
||||
ts = new Date(timestamp);
|
||||
} catch (e) {
|
||||
} catch {
|
||||
throw new InvalidHistoryTimestamp({ timestamp });
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ export class URLHelper {
|
||||
if (!['http:', 'https:'].includes(url.protocol)) return false;
|
||||
if (!url.hostname) return false;
|
||||
return true;
|
||||
} catch (_) {
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ export class FsStorageProvider implements StorageProvider {
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
} catch {
|
||||
// failed to read dir, stop recursion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ export async function autoMetadata(
|
||||
}
|
||||
|
||||
return metadata;
|
||||
} catch (e) {
|
||||
} catch {
|
||||
return metadata;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ export class CopilotCheckHtmlExecutor extends AutoRegisteredWorkflowExecutor {
|
||||
}
|
||||
}
|
||||
return false;
|
||||
} catch (e) {
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ export class CopilotCheckJsonExecutor extends AutoRegisteredWorkflowExecutor {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
} catch (e) {
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ class Storage<T extends object> {
|
||||
return this._options.config;
|
||||
}
|
||||
return cfg;
|
||||
} catch (err) {
|
||||
} catch {
|
||||
return this._cfg;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -521,7 +521,7 @@ function isConstructor(cls: any) {
|
||||
try {
|
||||
Reflect.construct(function () {}, [], cls);
|
||||
return true;
|
||||
} catch (error) {
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ function getCallbackUrl(location: Location) {
|
||||
const parsedUrl = new URL(url);
|
||||
return parsedUrl.pathname + parsedUrl.search;
|
||||
}
|
||||
} catch (_) {}
|
||||
} catch {}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ const generateUrl = ({
|
||||
url.searchParams.append('xywh', xywh);
|
||||
}
|
||||
return url.toString();
|
||||
} catch (e) {
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -72,7 +72,7 @@ export class FetchService extends Service {
|
||||
if (res.headers.get('Content-Type')?.includes('application/json')) {
|
||||
try {
|
||||
reason = await res.json();
|
||||
} catch (err) {
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ export const loader: LoaderFunction = async ({ request }) => {
|
||||
try {
|
||||
const { message } = await res.json();
|
||||
error = message;
|
||||
} catch (e) {
|
||||
} catch {
|
||||
error = 'failed to verify sign-in token';
|
||||
}
|
||||
return redirect(`/signIn?error=${encodeURIComponent(error)}`);
|
||||
|
||||
@@ -187,7 +187,7 @@ function warning(cond: any, message: string) {
|
||||
// enabling "pause on exceptions" in your JavaScript debugger.
|
||||
throw new Error(message);
|
||||
// eslint-disable-next-line no-empty
|
||||
} catch (e) {}
|
||||
} catch {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ const generateYml = platform => {
|
||||
sha512: hash,
|
||||
size: size,
|
||||
});
|
||||
} catch (e) {}
|
||||
} catch {}
|
||||
});
|
||||
// path & sha512 are deprecated
|
||||
yml.path = yml.files[0].url;
|
||||
|
||||
@@ -49,7 +49,7 @@ const getBaseTranslations = async (baseLanguage: { tag: string }) => {
|
||||
const main = async () => {
|
||||
try {
|
||||
await fs.access(RES_DIR);
|
||||
} catch (error) {
|
||||
} catch {
|
||||
fs.mkdir(RES_DIR).catch(console.error);
|
||||
console.log('Create directory', RES_DIR);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user