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

Force @return or @returns #167

Open
gajus opened this issue Oct 2, 2015 · 6 comments
Open

Force @return or @returns #167

gajus opened this issue Oct 2, 2015 · 6 comments

Comments

@gajus
Copy link

gajus commented Oct 2, 2015

Have a rule that forces user to use either @return tag or @returns.

@qfox
Copy link
Member

qfox commented Oct 2, 2015

Does checkAnnotations: { extra: { "returns": null } } to deny @returns would be fine?

@qfox
Copy link
Member

qfox commented Oct 2, 2015

I should say that currently you allowing both when you using closure or jsdoc3 tag set:

"return": true,
"returns": true,

But I'm not sure that this is right.
Closure compiler uses @return: https://developers.google.com/closure/compiler/docs/js-for-compiler#tag-return — Guess we can safely remove @returns from it.
JSDoc3 http://usejsdoc.org/tags-returns.html — supports both.

Ref: #76

@gajus
Copy link
Author

gajus commented Oct 2, 2015

Semantically, @return does not make sense. You don't give a command to the function. You describe what it does. It returns a value.

On Oct 2, 2015, at 22:07, Alexej Yaroshevich notifications@github.com wrote:

I should say that currently you allowing both when you using closure or jsdoc3 tag set:

"return": true,
"returns": true,

But I'm not sure that this is right.
Closure compiler uses @return: https://developers.google.com/closure/compiler/docs/js-for-compiler#tag-return — Guess we can safely remove @returns from it.
JSDoc3 http://usejsdoc.org/tags-returns.html — supports both.

Ref: #76


Reply to this email directly or view it on GitHub.

@gajus
Copy link
Author

gajus commented Oct 19, 2015

Has any decision been taken regarding this since?

@qfox
Copy link
Member

qfox commented Oct 19, 2015

I'd suggest to wait "multi-sets" (when you'll be able to use jsdoc3 with googleclosure addon) and then cleanup tag sets (e.g. remove returns from googleclosure set).

I think we shouldn't remove @return from jsdoc3 according to docs: http://usejsdoc.org/tags-returns.html
But there is no @returns in googleclosure: https://developers.google.com/closure/compiler/docs/js-for-compiler ;-)

What you think?

@gajus
Copy link
Author

gajus commented Oct 19, 2015

A rather general suggestion is to remove https://github.com/jscs-dev/jscs-jsdoc#checkannotations entirely. This rule is too broad. Instead, allow granular control (allowed, not allowed), case sensitive, control of all the supported tags.

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

2 participants