-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
require-returns-check doesn't work with generator functions #271
Comments
It has been enhanced considerably, but that would be a nice addition. However, I think we'd want to distinguish (maybe toggled with an option) cases where |
I've found https://astexplorer.net/ quite helpful in getting around the AST... |
Btw, while |
… or `gcc`), allow `yieldAsReturn` option as "always" or "argument" to treat `yield` as `return` (fixes gajus#271)
… or `gcc`), allow `yieldAsReturn` option as "always" or "argument" to treat `yield` as `return` (fixes gajus#271)
… or `gcc`), allow `yieldAsReturn` option as "always" or "argument" to treat `yield` as `return` (fixes gajus#271)
… or `gcc`), allow `yieldAsReturn` option as "always" or "argument" to treat `yield` as `return` (fixes gajus#271)
feat(require-returns-check): with `settings.jsdoc.mode` (`typescript` or `gcc`), allow `yieldAsReturn` option as "always" or "argument" to treat `yield` as `return` (fixes gajus#271)
When trying to write a generator function (
*myfunction
)require-returns-check
complains that no return statement is found even though the function contains theyield
keyword (which essentially works as a return.Example code (using Typescript):
I searched through existing issues and found that there were some issues with the checker and implicit returns before. I believe this would be a similar kind of issue, if someone gives me some tips I could try and PR a fix for it.
The text was updated successfully, but these errors were encountered: