Skip to main content

What it flags

The global Function and Object types, and the empty type literal {}, used as types. Function accepts any callable and lets calls pass any arguments; Object and {} accept every value except null and undefined, including strings and numbers. Each declaration, member, variable or cast is reported once. Like explicit-any, findings on an exported signature, type or public class member are at the default level and the rest are contextual. Function in a file that uses decorator metadata (Reflect.getMetadata, SetMetadata) is contextual, because those APIs take class constructors typed as Function. A line whose typescript-eslint, oxlint or Biome rule for these types is switched off is contextual too. It stays quiet for idiomatic empty-object types: string & {}, T | {}, the branches of a conditional type, T extends {} constraints, type arguments such as Component<{}> and defaults such as <P = {}>. A file that declares or imports its own Function or Object type is left alone. The same test, Storybook, declaration, generated and vendored files as explicit-any are skipped.

How to review

Use a specific signature such as (...args: unknown[]) => unknown for Function, and object, Record<string, unknown> or the real shape for Object and {}. There is no automatic fix, because callers may rely on the wide type. Mark a deliberate case with // loadwise-reviewed unsafe-wide-type -- <reason> on the line above.

Configuration

Set the rule to "off" in loadwise.config.json to drop its findings: