mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-12-06 00:32:35 -08:00
Lint
This commit is contained in:
1 parent
98731ff850
commit
fea53102dd
6 files changed
+34
-12
No files matched your search
@@ -1,7 +1,5 @@
|
||||
import { DesignPage } from '@/pages/design/design-page';
|
||||
|
||||
export function App() {
|
||||
return (
|
||||
<DesignPage />
|
||||
);
|
||||
return <DesignPage />;
|
||||
}
|
||||
@@ -15,7 +15,8 @@ export const errorReportingSettings = defineSettings({
|
||||
change: ChangeErrorReportingSettingsRequestT,
|
||||
});
|
||||
|
||||
export type ConsentAnswer = ErrorReportingConsent.ALLOWED | ErrorReportingConsent.DENIED;
|
||||
export type ConsentAnswer =
|
||||
ErrorReportingConsent.ALLOWED | ErrorReportingConsent.DENIED;
|
||||
|
||||
export interface ReportingIdentity {
|
||||
userId: string;
|
||||
|
||||
@@ -33,7 +33,9 @@ let sink: FakeSink;
|
||||
const setState = vi.fn();
|
||||
|
||||
beforeAll(async () => {
|
||||
setPlatform(fakePlatform({ errorReporting: { setState, sendCrash: async () => true } }));
|
||||
setPlatform(
|
||||
fakePlatform({ errorReporting: { setState, sendCrash: async () => true } })
|
||||
);
|
||||
fake = createFakeClient();
|
||||
setClient(fake);
|
||||
await initErrorReporting();
|
||||
@@ -178,7 +180,9 @@ describe('reportError', () => {
|
||||
|
||||
describe('defineMetric', () => {
|
||||
it('counts once per distinct attrs per session', () => {
|
||||
const used = defineMetric<{ method: string }>('test_method_used', { once: 'session' });
|
||||
const used = defineMetric<{ method: string }>('test_method_used', {
|
||||
once: 'session',
|
||||
});
|
||||
used({ method: 'manual' });
|
||||
used({ method: 'manual' });
|
||||
used({ method: 'auto' });
|
||||
|
||||
@@ -114,7 +114,11 @@ function startReplay() {
|
||||
return;
|
||||
}
|
||||
Sentry.addIntegration(
|
||||
Sentry.replayIntegration({ maskAllText: false, maskAllInputs: true, blockAllMedia: false })
|
||||
Sentry.replayIntegration({
|
||||
maskAllText: false,
|
||||
maskAllInputs: true,
|
||||
blockAllMedia: false,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
@@ -140,7 +144,10 @@ function applyIdentity({ userId, sessionId }: ReportingIdentity) {
|
||||
|
||||
let appliedConsent = ErrorReportingConsent.UNDECIDED;
|
||||
|
||||
function applyErrorReporting(next: ErrorReportingConsent, id: ReportingIdentity | null) {
|
||||
function applyErrorReporting(
|
||||
next: ErrorReportingConsent,
|
||||
id: ReportingIdentity | null
|
||||
) {
|
||||
platform.errorReporting?.setState({
|
||||
consent: next,
|
||||
userId: id?.userId ?? '',
|
||||
@@ -161,14 +168,18 @@ function watchLayers() {
|
||||
sink().breadcrumb({
|
||||
category: 'solarxr',
|
||||
message: `connection ${event.status}`,
|
||||
data: event.closeCode === undefined ? undefined : { closeCode: event.closeCode },
|
||||
data:
|
||||
event.closeCode === undefined ? undefined : { closeCode: event.closeCode },
|
||||
});
|
||||
return;
|
||||
case 'handler-error':
|
||||
reportError(event.error, { tags: { rpc: event.name } });
|
||||
return;
|
||||
default:
|
||||
sink().breadcrumb({ category: 'solarxr.rpc', message: `${event.kind} ${event.name}` });
|
||||
sink().breadcrumb({
|
||||
category: 'solarxr.rpc',
|
||||
message: `${event.kind} ${event.name}`,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
import type { Breadcrumb, ErrorContext, MetricAttrs, ReportLevel, ReportSink } from './sink';
|
||||
import type {
|
||||
Breadcrumb,
|
||||
ErrorContext,
|
||||
MetricAttrs,
|
||||
ReportLevel,
|
||||
ReportSink,
|
||||
} from './sink';
|
||||
|
||||
export interface FakeSink extends ReportSink {
|
||||
errors: { error: unknown; context: ErrorContext }[];
|
||||
|
||||
@@ -63,7 +63,9 @@ export function DesignPage() {
|
||||
<div class="grid grid-cols-2 gap-lg md:grid-cols-3">
|
||||
<For each={ROLES}>
|
||||
{(role) => (
|
||||
<div class={`${ROLE_CLASS[role]} flex flex-col gap-sm rounded-lg p-lg`}>
|
||||
<div
|
||||
class={`${ROLE_CLASS[role]} flex flex-col gap-sm rounded-lg p-lg`}
|
||||
>
|
||||
<span class="text-section">{role}</span>
|
||||
<div class="bg-surface-control hover:bg-surface-hover rounded-md p-sm">
|
||||
control / hover
|
||||
|
||||
Reference in new issue
Block a user