build: enable additional oxlint rules

This commit is contained in:
Peter Steinberger
2026-04-23 04:42:54 +01:00
parent dc5ab602df
commit 2e40ca2c15
16 changed files with 103 additions and 73 deletions

View File

@@ -492,7 +492,6 @@ export async function handleFeishuMessage(params: {
}
return;
}
} else {
}
try {

View File

@@ -329,7 +329,7 @@ export async function createMattermostDirectChannelWithRetry(
// Calculate exponential backoff delay with full-jitter
// Jitter is proportional to the exponential delay, not a fixed 1000ms
// This ensures backoff behaves correctly for small delay configurations
const exponentialDelay = initialDelayMs * Math.pow(2, attempt);
const exponentialDelay = initialDelayMs * 2 ** attempt;
const jitter = Math.random() * exponentialDelay;
const delayMs = Math.min(exponentialDelay + jitter, maxDelayMs);

View File

@@ -459,7 +459,7 @@ describe("Reconnect Backoff", () => {
const JITTER = 0.3;
for (let attempt = 0; attempt < 10; attempt++) {
const exponential = BASE * Math.pow(2, attempt);
const exponential = BASE * 2 ** attempt;
const capped = Math.min(exponential, MAX);
const minDelay = capped * (1 - JITTER);
const maxDelay = capped * (1 + JITTER);

View File

@@ -84,9 +84,7 @@ export async function withRetry<T>(
// Schedule the next retry with the configured backoff.
if (attempt < policy.maxRetries) {
const delay =
policy.backoff === "exponential"
? policy.baseDelayMs * Math.pow(2, attempt)
: policy.baseDelayMs;
policy.backoff === "exponential" ? policy.baseDelayMs * 2 ** attempt : policy.baseDelayMs;
logger?.debug?.(
`[qqbot:retry] Attempt ${attempt + 1} failed, retrying in ${delay}ms: ${lastError.message.slice(0, 100)}`,

View File

@@ -119,7 +119,7 @@ export async function sendMessage(
}
if (attempt < maxRetries - 1) {
await sleep(baseDelay * Math.pow(2, attempt));
await sleep(baseDelay * 2 ** attempt);
}
}

View File

@@ -104,7 +104,7 @@ export async function monitorTlonProvider(opts: MonitorTlonOpts = {}): Promise<v
if (attempt >= maxAttempts) {
throw error;
}
const delay = Math.min(30000, 1000 * Math.pow(2, attempt - 1));
const delay = Math.min(30000, 1000 * 2 ** (attempt - 1));
runtime.log?.(`[tlon] Retrying authentication in ${delay}ms...`);
await new Promise<void>((resolve, reject) => {
const timer = setTimeout(resolve, delay);

View File

@@ -376,7 +376,7 @@ export class UrbitSSEClient {
this.reconnectAttempts += 1;
const delay = Math.min(
this.reconnectDelay * Math.pow(2, this.reconnectAttempts - 1),
this.reconnectDelay * 2 ** (this.reconnectAttempts - 1),
this.maxReconnectDelay,
);