TypeScript is too loose when accepting functions:
type Fn = (a: string) => string;
const fn: Fn = () => '🥲'
// This is fine.
Do you think there's a way to enforce the usage of the a
parameter?
I have a situation where a function should only be used if a
is required; if a
isn't used, it's pointless.
A native example would be this: There's no point in using .some()
if you're not going to use the array value inside the callback.
[0,12,345].some(() => true)
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too