I am a Dev
I am a Dev10mo ago

Should i use lint rule explicit-function-return-type when use trpc?

I got warning for this lint https://typescript-eslint.io/rules/explicit-function-return-type/ When use trpc should I use it? For example here like this https://github.com/trpc/examples-next-prisma-starter/blob/e5cba42d56514bd633e4f0c83c10f4eb253dd45a/src/server/context.ts#L14
export function createInnerTRPCContext(
_opts: CreateContextOptions,
) {
return {};
}

export type Context = inferAsyncReturnType<typeof CreateContextOptions>;
export function createInnerTRPCContext(
_opts: CreateContextOptions,
) {
return {};
}

export type Context = inferAsyncReturnType<typeof CreateContextOptions>;
I can define the type like this
export interface Context {}


export function createInnerTRPCContext(_opts: CreateContextOptions): Context {
return {};
}
export interface Context {}


export function createInnerTRPCContext(_opts: CreateContextOptions): Context {
return {};
}
but suddenly there are times when it must be inferred, I don't know yet. I want to know if I should deactivate it or leave it active as I normally do. thank you
No description
0 Replies
No replies yetBe the first to reply to this messageJoin