-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
tools: enable getter-return lint rule #26615
Conversation
@@ -492,7 +492,7 @@ Object.defineProperty(Socket.prototype, 'readyState', { | |||
|
|||
|
|||
Object.defineProperty(Socket.prototype, 'bufferSize', { | |||
get: function() { | |||
get: function() { // eslint-disable-line getter-return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, eslint-disable-line getter-return
is unnecessary if this function returns undefined
explicitly.
get: function() {
if (this._handle) {
return this[kLastWriteQueueSize] + this.writableLength;
}
return undefined;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shisama in this case I thought it would be simplest to just add the comment. If you feel strongly about it, I can add the return undefined;
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cjihrig No, I am not particular about it. This is just a proposal. Thanks for your reply :)
CI: https://ci.nodejs.org/job/node-test-pull-request/21898/ EDIT(cjihrig): CI was green. |
PR-URL: nodejs#26615 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Masashi Hirano <shisama07@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
PR-URL: #26615 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Masashi Hirano <shisama07@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
PR-URL: nodejs#26615 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Masashi Hirano <shisama07@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
PR-URL: #26615 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Masashi Hirano <shisama07@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
We use getters a lot throughout core. I think it makes sense to lint for them returning values.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes