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
New Rule: Enforce return in getter #8449
New Rule: Enforce return in getter #8449
Comments
I'm 👍 to this idea. I think we should for sure do this in getter methods. I'm less sure about Object.defineProperty and friends just due to static analysis limitations, but I'm not opposed to adding it there either. |
@jaredmcateer Would you be interested in writing a PR if this gets accepted? |
I am travelling for a few weeks but I would definitely be up for writing
this rule when I am back and have the time.
…On Apr 19, 2017 4:55 AM, "Kevin Partington" ***@***.***> wrote:
@jaredmcateer <https://github.com/jaredmcateer> Would you be interested
in writing a PR if this gets accepted?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8449 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAvs5Atdbwv_UN9ehXXTD7ceIqdSOZfqks5rxSNEgaJpZM4M6rss>
.
|
Looks like we have enough votes to accept this. Just need a champion. Anyone willing to champion this issue? |
I'll champion. @jaredmcateer Let us know when you get a chance to start work on this, or if your schedule fills up and it looks like you won't be able to do it. No rush, and enjoy your travels! |
working on this. maybe the following weekend. |
Please describe what the rule should do:
Enforces that a return statement is present in property getters
What category of rule is this? (place an "X" next to just one item)
[ ] Enforces code style
[X] Warns about a potential error
[ ] Suggests an alternate way of doing something
[ ] Other (please specify:)
Provide 2-3 code examples that this rule will warn about:
Why should this rule be included in ESLint (instead of a plugin)?
I cannot think of a valid use case why someone would want to define a getter that did not return a value and it can be easily overlooked when reviewing a long list of getter/setters. I think the problem is generic enough that it should be included by ESLint.
The text was updated successfully, but these errors were encountered: