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

require-return-type says "must annotate undefined return type" on an async generator function #386

Closed
jedwards1211 opened this issue Feb 14, 2019 · 3 comments · Fixed by #387

Comments

@jedwards1211
Copy link
Contributor

jedwards1211 commented Feb 14, 2019

const resolvers = {
  TagState: {
    async *subscribe(): AsyncIterable<TagState> {
      await ...
      yield {...}
    }
  }
}
error  Must annotate undefined return type  flowtype/require-return-type

Annotating : void of course makes flow complain about the return type.

    "flowtype/require-return-type": [
      2,
      "always",
      {
        "annotateUndefined": "always",
        "excludeArrowFunctions": true,
        "excludeMatching":[
          "constructor", "componentDidMount",
          "componentDidUpdate", "componentWillReceiveProps",
          "componentWillUnmount"
        ]
      }
    ],

eslint: 5.13.0
eslint-plugin-flowtype: 3.4.1

@gajus
Copy link
Owner

gajus commented Feb 15, 2019

Thank you

@gajus
Copy link
Owner

gajus commented Feb 15, 2019

🎉 This issue has been resolved in version 3.4.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gajus gajus added the released label Feb 15, 2019
@jedwards1211
Copy link
Contributor Author

Thanks! It was really easy to figure out where to fix this and how to write tests for it. Good job on making the code organized! 💯

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