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

bug: @returns does not respect jsdocUseColumns false #3

Closed
shunkica opened this issue Jul 21, 2023 · 5 comments · Fixed by #6
Closed

bug: @returns does not respect jsdocUseColumns false #3

shunkica opened this issue Jul 21, 2023 · 5 comments · Fixed by #6
Labels

Comments

@shunkica
Copy link

Here is the related fixture:

module.exports = {
  only: true,
  jsdocPrintWidth: 95,
  jsdocUseColumns: false,
};

//# input

/**
 * @param {foo} bar baz
 * @returns {number} Returns how the node is positioned relatively to the reference node
 * according to the bitmask. 0 if reference node and given node are the same.
 */

//# output

/**
 * @param {foo} bar
 * Baz.
 * @returns {number}
 * Returns how the node is positioned relatively to the reference node according to the
 * bitmask. 0 if reference node and given node are the same.
 */

The actual output is:

/**
 * @param {foo} bar
 * Baz.
 * @returns {number} Returns how the node is positioned relatively to the reference node
 *                   according to the bitmask. 0 if reference node and given node are the same.
 */
@shunkica
Copy link
Author

The problem seems to be that the description of @returns gets placed in the name property instead of the description property, but @returns shouldn't have a name property.

@shunkica
Copy link
Author

shunkica commented Jul 21, 2023

The issue seems to originate from comment-parser

It is already reported here
There is a possible workaround mentioned, and no plan to fix this behavior has been announced.

@homer0
Copy link
Owner

homer0 commented Jul 22, 2023

@shunkica thanks for tracking it down :D. @returns is not the only tag with that issue, and I already have workarounds in place for cases with no description, no name, or description split between name and description.

For some reason, it seems like I intentionally wanted the description of the @returns to match the description of the @params, on column mode, so I had it on the wrong group.

Since, I believe, you are still using v6, a workaround to get this fix would be to follow these instructions to extend the plugin, and override getTagsWithDescriptionAsName && getTagsWithNameAsDescription to match the changes in this commit.

@shunkica
Copy link
Author

Thanks for the response. We have moved to v7 since so it should be good once you release a fix.

@github-actions
Copy link

🎉 This issue has been resolved in version 7.0.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants