Skip to content

Conversation

@RunDevelopment
Copy link
Contributor

This PR can be seen as a continuation of #4135.

I removed the JSDoc annotations in .d.ts files.

Before:

/**  * Some docs.  * @param {number} a  * @param {number} b  * @returns {number}  */ export function add_u32(a: number, b: number): number;

After:

/**  * Some docs.  */ export function add_u32(a: number, b: number): number;

I did this because JSDoc annotations (so @param and @returns) are just unnecessary noise. They just repeat the function signature and contain zero information.

Note that this only affects the generates TS files. The JSDoc annotations are wanted in JS files and are remain unchanged.


With this PR, I would actually consider the form of generated .d.ts files to be good. At least for my use case, they are now exactly what I want.

@daxpedda daxpedda added the needs review Needs a review by a maintainer. label Oct 12, 2024
Copy link
Member

@daxpedda daxpedda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately I'm not really familiar with the TS ecosystem.
Is there some guidelines where something like this is outlines?

If you just point me into the right direction I'm happy to go ahead with this.

@RunDevelopment
Copy link
Contributor Author

Here's an SO post explaining doc comments in TypeScript. The top answer explains it quite well.

Copy link
Member

@daxpedda daxpedda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@daxpedda daxpedda added waiting for author Waiting for author to respond and removed needs review Needs a review by a maintainer. labels Oct 12, 2024
@daxpedda daxpedda merged commit ec6b042 into wasm-bindgen:main Oct 12, 2024
41 checks passed
@RunDevelopment RunDevelopment deleted the rm-jsdoc-from-d.ts branch October 12, 2024 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting for author Waiting for author to respond

2 participants