You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 16, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 16, 2023. It is now read-only.
no-unnecessary-generics rule within callbacks #273
The unnecessary-generics rule seems to not consider callbacks, this code is flagged by the rule:
export function get<T>(key: string, callback: (data: T | {}) => void): void;
However, in this case the type parameter T might have been used only once, but it has the effect that typing is enforced when using the callback and therefore the generics isn't unnecessary and cannot be replaced by anything else with the same typing effect. E.g the above function can now be called with
get<{something: string}>("bla", (data) => /* data has the corecct type here */);
Activity
[-]no-unnecessary-generics rule[/-][+]no-unnecessary-generics rule within callbacks[/+]