fix: add prefer-readonly rule (#5122)

This commit is contained in:
LongYinan committed 2023-11-29 15:19:00 +08:00
1 parent e9ea67bd38
commit 7a7cbc45d7
21 files changed
+39 -36

No files matched your search

+3 -3
View File
@@ -54,7 +54,7 @@ export class TraceReporter {
private spansCache = new Array<TraceSpan>();
private reportIntervalId: number | undefined | NodeJS.Timeout;
private reportInterval = 60_000;
private readonly reportInterval = 60_000;
private static instance: TraceReporter;
@@ -175,7 +175,7 @@ export class TraceReporter {
};
}
private initTraceReport = () => {
private readonly initTraceReport = () => {
if (!this.reportIntervalId && TraceReporter.shouldReportTrace) {
if (typeof window !== 'undefined') {
this.reportIntervalId = window.setInterval(
@@ -191,7 +191,7 @@ export class TraceReporter {
}
};
private reportHandler = () => {
private readonly reportHandler = () => {
if (this.spansCache.length <= 0) {
clearInterval(this.reportIntervalId);
this.reportIntervalId = undefined;