I'm trying to force correct typings on all useCallbacks in react with typescript and eslint.
By default the arguments defined in useCallback are of type any.
// @types/react
function useCallback<T extends (...args: any[]) => any>(callback: T, deps: DependencyList): T;
What this means is that both typescript and typescript-eslint's no-explicit-any rule doesn't pick this up (as it's defined as any).
So if I write the following code:
const callback = React.useCallback((value) => {
...
}, []);
I would like either typescript or eslint to throw me an error as value is any here.
Is there an eslint plugin that can handle this for me? Or am I missing something obvious here?