Skip to content

no-unsafe-function-type

Reports the global type Function used as a type, as an interface ... extends target and as an implements target. A class that extends Function (a value) is not reported.

Function accepts any callable value, and calling one takes any arguments and returns any, so the compiler no longer checks the call.

To fix, write the signature ((x: number) => string), or (...args: never[]) => unknown for any function without losing the check.

Reported
let f: Function;
...
let t: string;
js:
lint:
rules:
no-unsafe-function-type: warn # off (default), warn, error

Enabled by the presets: js/typescript-eslint-recommended, js/biome-recommended.

Suppress one line with sudsy-disable-next-line no-unsafe-function-type in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
typescript-eslint no-unsafe-function-type full