infra: add linting and formatting for js projects (#230)
* wip * wip * wip * format * wip(mobile): lint and format * cleanup * nits * nits * idiomatic react * nit * format all root files
This commit was merged in pull request #230.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { ipcMain, type IpcMainInvokeEvent } from "electron";
|
||||
import { reportError } from "@/lib/errors";
|
||||
import { ipcMain, type IpcMainInvokeEvent } from 'electron';
|
||||
import { reportError } from '@/lib/errors';
|
||||
|
||||
type InvokeHandler = (
|
||||
event: IpcMainInvokeEvent,
|
||||
@@ -16,7 +16,7 @@ export function safeHandle(channel: string, handler: InvokeHandler): void {
|
||||
return await handler(event, ...(args as unknown[]));
|
||||
} catch (err) {
|
||||
reportError(err, { scope: `ipc.${channel}` });
|
||||
const message = err instanceof Error ? err.message : "IPC error";
|
||||
const message = err instanceof Error ? err.message : 'IPC error';
|
||||
throw new Error(message);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { app } from "electron";
|
||||
import * as Sentry from "@sentry/electron/main";
|
||||
import { appConfig, appEnv } from "@/config/env";
|
||||
import { installErrorSinks } from "@/lib/errors";
|
||||
import { app } from 'electron';
|
||||
import * as Sentry from '@sentry/electron/main';
|
||||
import { appConfig, appEnv } from '@/config/env';
|
||||
import { installErrorSinks } from '@/lib/errors';
|
||||
|
||||
/**
|
||||
* Initialise Sentry for the main process. Captures uncaught exceptions from
|
||||
@@ -18,12 +18,11 @@ export function initSentryMain(): void {
|
||||
});
|
||||
|
||||
installErrorSinks({
|
||||
capture: (err, context) =>
|
||||
Sentry.captureException(err, { extra: context }),
|
||||
capture: (err, context) => Sentry.captureException(err, { extra: context }),
|
||||
breadcrumb: (err, context) =>
|
||||
Sentry.addBreadcrumb({
|
||||
category: "error",
|
||||
level: "error",
|
||||
category: 'error',
|
||||
level: 'error',
|
||||
message: err instanceof Error ? err.message : String(err),
|
||||
data: context,
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user