-
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 <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Masashi Hirano <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]>
PR-URL: #26615 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Masashi Hirano <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]>
PR-URL: nodejs#26615 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Masashi Hirano <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]>
PR-URL: #26615 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Masashi Hirano <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]>
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