What it flags
An explicitany in TypeScript source: annotations such as : any, any[], Record<string, any> or Promise<any>, type arguments, as any, <any>value and catch (error: any). Each function signature, member, variable, type alias, cast or call is reported once, however many any tokens it holds.
The finding is at the default level when the any is part of the module’s surface: an exported function’s parameters or return type, an exported type alias or interface, or a public member of an exported class, where the missing types spread to every caller. Other uses are contextual:
- local variables, casts, call type arguments and
catchvariables; anyas a type argument of a generic other than the built-in containers (Array,Record,Promise,Map,Set,Partial,Readonly), or as a type parameter default, where it usually means “any instantiation” andunknownfails variance checks;- a line whose ESLint, oxlint or Biome
no-explicit-anyrule is switched off by a directive.
extends constraints and conditional-type patterns such as T extends (...args: any[]) => any, which unknown cannot express; for the implementation signature of an overloaded function, which callers never see; and for value as any as T, which double-type-assertion reports. Declaration files, test, fixture and Storybook files, generated code (including GraphQL Code Generator output) and vendored code are skipped.
How to review
Name the real type where it is known. Otherwise useunknown and narrow the value before use, for example with typeof, instanceof Error or a schema. Replacing any with unknown usually needs those narrowing changes at each use, so there is no automatic fix. Mark a deliberate case with // loadwise-reviewed explicit-any -- <reason> on the line above.
Configuration
Set the rule to"off" in loadwise.config.json to drop its findings: