Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

fix: keep debounce callbacks typed without any (#11404)

Shahmir Varqha2ba982317c7c
diff --git a/frontend/src/hooks/useDebounce.ts b/frontend/src/hooks/useDebounce.ts
index fbeb2d1775..00b8e025e4 100644
--- a/frontend/src/hooks/useDebounce.ts
+++ b/frontend/src/hooks/useDebounce.ts
@@ -77,8 +77,7 @@ export function useDebounceControlledState<T>(opts: {
};
}
-// oxlint-disable-next-line typescript/no-explicit-any
-export function useDebouncedCallback<T extends (...args: any[]) => unknown>(
+export function useDebouncedCallback<T extends (...args: never[]) => unknown>(
callback: T,
delay: number,
) {
diff --git a/frontend/src/hooks/useEventListener.ts b/frontend/src/hooks/useEventListener.ts
index a889e25d7c..1188d86188 100644
--- a/frontend/src/hooks/useEventListener.ts
+++ b/frontend/src/hooks/useEventListener.ts
@@ -62,8 +62,7 @@ export function useEventListener(
return;
}
- // oxlint-disable-next-line typescript/no-explicit-any
- const eventListener = (event: any) => savedListener.current(event);
+ const eventListener = (event: Event) => savedListener.current(event);
target.addEventListener(type, eventListener, options);
return () => {
diff --git a/frontend/src/utils/tracer.ts b/frontend/src/utils/tracer.ts
index 35e6a09818..136f553fe4 100644
--- a/frontend/src/utils/tracer.ts
+++ b/frontend/src/utils/tracer.ts
@@ -1,6 +1,5 @@
/* Copyright 2026 Marimo. All rights reserved. */
-/* oxlint-disable typescript/no-explicit-any */
/* oxlint-disable no-console -- for debugging */
import { Logger } from "./Logger";
@@ -61,12 +60,17 @@ export class Tracer {
}
}
- public wrapAsync<T extends (...args: any[]) => Promise<any>>(
+ public wrapAsync<T extends (...args: never[]) => Promise<unknown>>(
fn: T,
name?: string,
+ attributes?: Record<string, unknown>,
+ ): T;
+ public wrapAsync<Args extends unknown[], Result>(
+ fn: (...args: Args) => Promise<Result>,
+ name?: string,
attributes: Record<string, unknown> = {},
- ): T {
- return (async (...args) => {
+ ): (...args: Args) => Promise<Result> {
+ return async (...args) => {
const span = this.startSpan(name || fn.name, attributes);
try {
const result = await fn(...args);
@@ -76,7 +80,7 @@ export class Tracer {
this.endSpan(span, "error");
throw error;
}
- }) as T;
+ };
}
public logSpans(): void {