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

#2521 changed the behavior of documented arrow function #2824

Open
hoodmane opened this issue Dec 30, 2024 · 2 comments
Open

#2521 changed the behavior of documented arrow function #2824

hoodmane opened this issue Dec 30, 2024 · 2 comments

Comments

@hoodmane
Copy link

hoodmane commented Dec 30, 2024

Consider the following source:

/**
 * Here is some documentation.
 */
export const f = () => {};

/**
 * Here is some documentation
 */
export function g() {}

Commit d1be956 changed how this is handled. If I checkout the commit before it e30ed7a, run npm ci && npm build and then run typedoc on this file, the rendering of f and g are indistinguishable:

image

On d1be956 the output changed so that the comment is above f. The output for g is unchanged:

image

@hoodmane hoodmane added the bug Functionality does not match expectation label Dec 30, 2024
@hoodmane
Copy link
Author

Reading #2521 it is unclear to me if this was the intended behavior of the change. My apologies for the noise if it was.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jan 12, 2025

This was intended at the time, though I'm less certain that it was a good idea after living with it for a while... The intent at the time was for const fn = () => 123 to be treated in the same way type Fn = () => 123 would be, where the comment doesn't belong to the signature, but to the function/type alias that owns the signature.

@Gerrit0 Gerrit0 removed the bug Functionality does not match expectation label Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants