roblox-ts / eslint-plugin-roblox-ts

7 stars 6 forks source link

Rule for mapped types that transform the `this` argument #44

Open Dionysusnu opened 6 months ago

Dionysusnu commented 6 months ago

In the following case, ProducerDispatchers causes an implicit conversion from method-like to static-like functions in the result object.

There might be cases where this behaviour is correct for the underlying implementation of createProducers, so I don't think it makes sense as a compiler error. Implementation would also be tricky, since this can happen in .d.ts files and isn't easily checked in the function call signature. In most cases though, it's undesired and leads to runtime errors, so it seems like a good fit for a lint rule.