itwinjs-core icon indicating copy to clipboard operation
itwinjs-core copied to clipboard

Eslint Rule unified-signatures should not flag overload functions needed for JSdoc tags

Open MichaelSwigerAtBentley opened this issue 1 month ago • 2 comments

Issue: Currently, if we overload a function to deprecate an older version with different parameters, or add a new overload with new parameters, unified-signatures will flag these overloads if they can be merged into one (which is often the case). However, we cannot do this as the different signatures will have different jsdocs.

Fix: There is an eslint option for unified-signatures that will ignore overloads with different jsdocs.

We should apply this option, and remove the lint exceptions.

MichaelSwigerAtBentley avatar Dec 11 '25 17:12 MichaelSwigerAtBentley

Would this change be done in iTwin/eslint-plugin, so that other pkgs can take advantage?

hl662 avatar Dec 11 '25 20:12 hl662

It depends if other consumers of the plugin use JSdocs in the same way that we do.

I was also considering removing the rule. It seems very niche, especially when most overloads we create are for compatibility reasons, and would almost certainly ignore this lint rule. What cases would the clean up our code?

MichaelSwigerAtBentley avatar Dec 11 '25 20:12 MichaelSwigerAtBentley