fix: add prefer-readonly rule (#5122)

This commit is contained in:
LongYinan
2023-11-29 04:44:25 +00:00
parent e9ea67bd38
commit 7a7cbc45d7
21 changed files with 39 additions and 36 deletions

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;