no-known-value-widening
WarningDo not annotate literals as unknown, object or Record<string, T>. Use satisfies to keep the inferred keys.
const handlers: Record<string, Handler> = { start: startHandler,};const payload: unknown = "ready";const tokens: { [key: string]: string } = { primary: "#fff" };const handlers = { start: startHandler,} satisfies Record<string, Handler>;const cache: Record<string, User> = {};const variables: Record<ColorScheme, string> = { dark: "#000", light: "#fff" };How to fix
Drop the annotation, or use satisfies Record<string, Handler> to check the shape and keep the known keys.
Empty objects used as accumulators and Record types with a finite key type are allowed.