memoize-one icon indicating copy to clipboard operation
memoize-one copied to clipboard

Don't allow `resultFn` to resolve to implicit any params

Open oriSomething opened this issue 3 years ago • 2 comments

I saw this trick in React 18 types: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/56210/files#diff-32cfd8cb197872bcba371f5018185d2e75fa540b52cda2dd7d8ac12dcc021299R1068 And the discussion https://github.com/DefinitelyTyped/DefinitelyTyped/issues/52873#issuecomment-845806435

I think we should ban implicit any as well. The only issue is that it might be a breaking change, But I don't think so, from looking at memoize-one definitions. It might only force some users to add types or explicit any.

oriSomething avatar Apr 12 '22 14:04 oriSomething

So it seems, we can't do the same conversion 😑 because Parameters and ReturnType don't work with Function. The other question is should we at least replace any with unknown to provide a bit stricter detentions

oriSomething avatar Apr 12 '22 14:04 oriSomething

It seems also unknown has some issues, I wonder if there is any TS wizard that can solve this issue, if it's possible

oriSomething avatar Apr 12 '22 14:04 oriSomething

Is this still an issue?

alexreardon avatar Oct 06 '23 05:10 alexreardon

It's still an issue, but I don't think it's fixable anyway

oriSomething avatar Feb 11 '24 07:02 oriSomething