Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Add lint rule for "what do I return from a hook?" #234

Closed
lemonmade opened this issue Apr 2, 2019 · 2 comments · Fixed by #237
Closed

Add lint rule for "what do I return from a hook?" #234

lemonmade opened this issue Apr 2, 2019 · 2 comments · Fixed by #237
Assignees

Comments

@lemonmade
Copy link
Member

lemonmade commented Apr 2, 2019

Or, just a best practice guide, if we can't do a linting rule.

@lemonmade lemonmade changed the title Document/ add lint rule for "what do I return from a hook?" Add lint rule for "what do I return from a hook?" Apr 2, 2019
@cartogram
Copy link
Contributor

cartogram commented Apr 6, 2019

Just a start, but here is a basic check for max 'things' returned.
https://astexplorer.net/#/gist/b015f5cd1b41b049f2feffdff6d9f3a9/a616e30f1d02733e274d6c96133d285c6450ecec
Could build on this to limit returning only objects or only arrays under certain circumstances.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants