I want infer something in typescript like this:
export type InferSomething<T> = T extends (...args: any[]) => Promise<infer U> ? U : never;
This works but generates the error https://typescript-eslint.io/rules/no-explicit-any/ in my IDE.
I generally like the rule, because any
is usually very bad in TS but here I use it for inference and any
does not cause any harm.
I am aware that I can disable the rule locally or globally but my question is:
Is it possible to adjust my inference that I don’t have to disable the specific rule?