no-unsafe-function-type
JavaScript / TypeScriptsuspiciousno fixdefault: offjs/typescript-eslint-recommendedjs/biome-recommended
What it does
Section titled “What it does”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.
Why it matters
Section titled “Why it matters”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.
Example
Section titled “Example”let f: Function;...let t: string;Configuration
Section titled “Configuration”js: lint: rules: no-unsafe-function-type: warn # off (default), warn, errorEnabled 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.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| typescript-eslint | no-unsafe-function-type |
full |