Skip to contentSlop Block

no-unknown-returns

Error

Declare a concrete return type, not unknown, dynamic, Object or their Promise/Future forms.

function loadUser(): unknown {Do not declare unknown as a return type	return input;}
async function loadUser(): Promise<unknown> {Do not declare unknown as a return type	return fetchUser();}
const loadUser = (): PromiseLike<unknown> => fetchUser();Do not declare unknown as a return type
// ast-grep-ignore: no-unknown-returns-typescript

How to fix

Declare the actual return type. Parse values from outside the program before returning them.