Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove JSDoc annotations in TS files #4187

Merged
merged 5 commits into from
Oct 12, 2024

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
Collaborator

@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
Collaborator

@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!

CHANGELOG.md Outdated Show resolved Hide resolved
@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 rustwasm: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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants