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

Check yield and @yields/@yield #354

Closed
brettz9 opened this issue Jul 23, 2019 · 3 comments · Fixed by #675
Closed

Check yield and @yields/@yield #354

brettz9 opened this issue Jul 23, 2019 · 3 comments · Fixed by #675

Comments

@brettz9
Copy link
Collaborator

brettz9 commented Jul 23, 2019

While #271 aims to support yield with require-returns-check (in environments like TypeScript where there is no @yields tag support and thus it makes some sense to use @returns to contain this information), I think a new rule ought to be added for regular jsdoc mode (i.e., not TypeScript or GCC which don't support @yields/@yield) to ensure a yield is present when the @yields/@yield tag is used.

Similarly, I think we need another rule equivalent to require-returns as well, which checks that if a yield is present, that there is a @yields/@yield tag.

And this rule should allow IterableIterator<void> and IterableIterator<SomeType> within @returns as well (for TypeScript/GCC which don't support @yields currently). @returns might perhaps be reserved for the generator return values or if using the actual Generator/iterator such as IterableIterator with a generic/template, then use any return value as the variable portion rather than the yield value.

@golopot
Copy link
Collaborator

golopot commented Jul 24, 2019

This will be a seldom used rule. I will accept it if enough people shows interest in it. Otherwise it is better to keep the project small and simple.

@brettz9
Copy link
Collaborator Author

brettz9 commented Jul 24, 2019

People have already expressed interest by filing an issue, and I would like the same. This is eslint-plugin-jsdoc not eslint-plugin-jsdoc-small-subset-of-tags. Yes, we don't want bloat, but there is no reason we can't meet multiple needs and users can ignore rules they don't want. What is so oppressive about having an extra rule that you don't personally use? We are presumably not just here to meet your or my needs, and we're not talking about some obscure, project-specific rules, but a rule to ensure that the standard tag is documenting as expected.

@brettz9 brettz9 mentioned this issue Aug 10, 2019
13 tasks
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Oct 30, 2019
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Jan 21, 2021
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Jan 21, 2021
@brettz9 brettz9 mentioned this issue Jan 21, 2021
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Jan 21, 2021
…er form) is present in the function body; fixes gajus#354
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Jan 21, 2021
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Jan 21, 2021
…er form) is present in the function body; fixes gajus#354
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Jan 21, 2021
…er form) is present in the function body; fixes gajus#354
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Jan 23, 2021
…er form) is present in the function body; fixes gajus#354
brettz9 added a commit that referenced this issue Jan 23, 2021
…er form) is present in the function body; fixes #354
@gajus
Copy link
Owner

gajus commented Jan 23, 2021

🎉 This issue has been resolved in version 31.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gajus gajus added the released label Jan 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants