fix: remove unused variables (#7968)

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