Skip to content

require-description-complete-sentence tries to capitalize variable names in @return #65

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

Closed
cscott opened this issue Feb 27, 2018 · 5 comments

Comments

@cscott
Copy link
Contributor

cscott commented Feb 27, 2018

For example:

 	 * @return {Object}
-	 *   @return {any} return.value
-	 *   @return {boolean} return.modified If the value of the attribute changed since we parsed the wikitext
-	 *   @return {boolean} return.fromsrc Whether we got the value from source-based roundtripping
+	 *   @return {any} Return.value.
+	 *   @return {boolean} Return.modified If the value of the attribute changed since we parsed the wikitext.
+	 *   @return {boolean} Return.fromsrc Whether we got the value from source-based roundtripping.
 	 */
@bary12
Copy link
Contributor

bary12 commented Feb 28, 2018

It assumes there is no variable name, I think the standard JSdoc way if doing it is with @typedef

@cscott
Copy link
Contributor Author

cscott commented Feb 28, 2018

It seems like this is a bit of a grey area in the jsdoc docs: jsdoc/jsdoc.github.io#115

In any case, it is probably straightforward to make the code skip the first part of the string if the tag is @return and the string starts with return.<identifier>, and that ought to work fine whatever convention you are using.

@bary12
Copy link
Contributor

bary12 commented Feb 28, 2018

It's not obvious as this code is already a mess. It should be done by adding a custom parser to comment-parser which excludes it from the description.

@brettz9 brettz9 added the bug label May 16, 2019
@brettz9
Copy link
Collaborator

brettz9 commented May 16, 2019

This may also tie into #11

@brettz9 brettz9 added enhancement and removed bug labels Jul 9, 2019
@brettz9
Copy link
Collaborator

brettz9 commented Feb 9, 2022

At this point, I would hesitate to support this. As a style that is not formally documented at the very least, and is not supported in TypeScript JSDoc (and with our plan to move to TypeScript JSDoc by default)--which has an easier object shorthand syntax that can be used in its place, I don't think this is something even for "jsdoc" mode.

Closing, therefore, though feel free to comment further as needed.

@brettz9 brettz9 closed this as completed Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants