typestack / class-transformer

Decorator-based transformation, serialization, and deserialization between objects and classes.
MIT License
6.81k stars 500 forks source link

fix: JSDoc comments do not automatically apply to overloads #1704

Open sliekens opened 4 months ago

sliekens commented 4 months ago

Description

In the index.ts file (src/index.ts), only the first overload of each function was documented using JSDoc comments. The intention here seems to be that the same comment should be displayed for all overloads, but that is not how (most?) editors work.

For example, the @deprecated warning for plainToClass does not appear for the second and third overload.

Minimal code-snippet showcasing the problem

https://github.com/typestack/class-transformer/blob/a073b5ea218dd4da9325fe980f15c1538980500e/src/index.ts#L12-L24

Expected behavior

Every function should be documented individually.

Actual behavior

Deprecated overloads are not displayed as such in editors.