Skip to content

Commit 641c08c

Browse files
committed
lint fixes
1 parent 4c195df commit 641c08c

File tree

6 files changed

+25
-17
lines changed

6 files changed

+25
-17
lines changed

packages/replay/src/eventBuffer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import { captureException } from '@sentry/core';
55
import { logger } from '@sentry/utils';
66

7-
import type { EventBuffer, RecordingEvent, WorkerAddEventResponse,WorkerRequest, WorkerResponse } from './types';
7+
import type { EventBuffer, RecordingEvent, WorkerAddEventResponse, WorkerRequest, WorkerResponse } from './types';
88
import workerString from './worker/worker.js';
99

1010
interface CreateEventBufferParams {
@@ -60,7 +60,7 @@ class EventBufferArray implements EventBuffer {
6060
}
6161

6262
this._events.push(event);
63-
return true
63+
return true;
6464
}
6565

6666
public finish(): Promise<string> {
@@ -182,7 +182,7 @@ export class EventBufferCompressionWorker implements EventBuffer {
182182
*/
183183
private async _sendEventToWorker(event: RecordingEvent): Promise<WorkerAddEventResponse> {
184184
const promise = this._postMessage({
185-
id: this._getAndIncrementId(),
185+
id: this._getAndIncrementId(),
186186
method: 'addEvent',
187187
args: [event],
188188
});

packages/replay/src/replay.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ export class ReplayContainer implements ReplayContainerInterface {
464464

465465
// We need to clear existing events on a checkout, otherwise they are
466466
// incremental event updates and should be appended
467-
addEvent(this, event, isCheckout);
467+
void addEvent(this, event, isCheckout);
468468

469469
// Different behavior for full snapshots (type=2), ignore other event types
470470
// See https://github.com/rrweb-io/rrweb/blob/d8f9290ca496712aa1e7d472549480c4e7876594/packages/rrweb/src/types.ts#L16
@@ -570,7 +570,7 @@ export class ReplayContainer implements ReplayContainerInterface {
570570
}
571571

572572
this.addUpdate(() => {
573-
addEvent(this, {
573+
void addEvent(this, {
574574
type: EventType.Custom,
575575
// TODO: We were converting from ms to seconds for breadcrumbs, spans,
576576
// but maybe we should just keep them as milliseconds
@@ -688,7 +688,7 @@ export class ReplayContainer implements ReplayContainerInterface {
688688
*/
689689
createCustomBreadcrumb(breadcrumb: Breadcrumb): void {
690690
this.addUpdate(() => {
691-
addEvent(this, {
691+
void addEvent(this, {
692692
type: EventType.Custom,
693693
timestamp: breadcrumb.timestamp || 0,
694694
data: {
@@ -703,7 +703,7 @@ export class ReplayContainer implements ReplayContainerInterface {
703703
* Observed performance events are added to `this.performanceEvents`. These
704704
* are included in the replay event before it is finished and sent to Sentry.
705705
*/
706-
addPerformanceEntries(): Promise<Array<WorkerAddEventResponse|null>> {
706+
addPerformanceEntries(): Promise<Array<WorkerAddEventResponse | null>> {
707707
// Copy and reset entries before processing
708708
const entries = [...this.performanceEvents];
709709
this.performanceEvents = [];

packages/replay/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ export interface EventBuffer {
224224
* Returns true if event was successfully added.
225225
*/
226226
addEvent(event: RecordingEvent, isCheckout?: boolean): Promise<WorkerAddEventResponse>;
227-
227+
228228
/**
229229
* Clears and returns the contents and the buffer.
230230
*/

packages/replay/src/util/addEvent.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
21
import { SESSION_IDLE_DURATION } from '../constants';
32
import type { RecordingEvent, ReplayContainer, WorkerAddEventResponse } from '../types';
43

54
/**
65
* Add an event to the event buffer
76
*/
8-
export async function addEvent(replay: ReplayContainer, event: RecordingEvent, isCheckout?: boolean): Promise<WorkerAddEventResponse|null> {
7+
export async function addEvent(
8+
replay: ReplayContainer,
9+
event: RecordingEvent,
10+
isCheckout?: boolean,
11+
): Promise<WorkerAddEventResponse | null> {
912
if (!replay.eventBuffer) {
1013
// This implies that `_isEnabled` is false
1114
return null;

packages/replay/src/util/addMemoryEntry.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,18 @@ interface MemoryInfo {
1414
* Create a "span" for the total amount of memory being used by JS objects
1515
* (including v8 internal objects).
1616
*/
17-
export async function addMemoryEntry(replay: ReplayContainer): Promise<Array<WorkerAddEventResponse|null>> {
17+
export async function addMemoryEntry(replay: ReplayContainer): Promise<Array<WorkerAddEventResponse | null>> {
1818
// window.performance.memory is a non-standard API and doesn't work on all browsers, so we try-catch this
1919
try {
20-
return Promise.all(createPerformanceSpans(replay, [
21-
// @ts-ignore memory doesn't exist on type Performance as the API is non-standard (we check that it exists above)
22-
createMemoryEntry(WINDOW.performance.memory),
23-
]));
20+
return Promise.all(
21+
createPerformanceSpans(replay, [
22+
// @ts-ignore memory doesn't exist on type Performance as the API is non-standard (we check that it exists above)
23+
createMemoryEntry(WINDOW.performance.memory),
24+
]),
25+
);
2426
} catch (error) {
2527
// Do nothing
26-
return []
28+
return [];
2729
}
2830
}
2931

packages/replay/src/util/createPerformanceSpans.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ import { addEvent } from './addEvent';
66
/**
77
* Create a "span" for each performance entry. The parent transaction is `this.replayEvent`.
88
*/
9-
export function createPerformanceSpans(replay: ReplayContainer, entries: ReplayPerformanceEntry[]): Promise<WorkerAddEventResponse|null>[] {
9+
export function createPerformanceSpans(
10+
replay: ReplayContainer,
11+
entries: ReplayPerformanceEntry[],
12+
): Promise<WorkerAddEventResponse | null>[] {
1013
return entries.map(({ type, start, end, name, data }) =>
1114
addEvent(replay, {
1215
type: EventType.Custom,

0 commit comments

Comments
 (0)