summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.eslintrc.js1
-rw-r--r--lib/internal/http2/compat.js2
-rw-r--r--lib/net.js2
-rw-r--r--test/parallel/test-util-inspect.js4
4 files changed, 5 insertions, 4 deletions
diff --git a/.eslintrc.js b/.eslintrc.js
index 4863bbd998..f5202002f3 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -83,6 +83,7 @@ module.exports = {
'func-call-spacing': 'error',
'func-name-matching': 'error',
'func-style': ['error', 'declaration', { allowArrowFunctions: true }],
+ 'getter-return': 'error',
'indent': ['error', 2, {
ArrayExpression: 'first',
CallExpression: { arguments: 'first' },
diff --git a/lib/internal/http2/compat.js b/lib/internal/http2/compat.js
index 23266eb6c2..84630a3717 100644
--- a/lib/internal/http2/compat.js
+++ b/lib/internal/http2/compat.js
@@ -462,7 +462,7 @@ class Http2ServerResponse extends Stream {
// This is compatible with http1 which removes socket reference
// only from ServerResponse but not IncomingMessage
if (this[kState].closed)
- return;
+ return undefined;
const stream = this[kStream];
const proxySocket = stream[kProxySocket];
diff --git a/lib/net.js b/lib/net.js
index d5a7ba6371..7b4f3f29da 100644
--- a/lib/net.js
+++ b/lib/net.js
@@ -495,7 +495,7 @@ Object.defineProperty(Socket.prototype, 'readyState', {
Object.defineProperty(Socket.prototype, 'bufferSize', {
- get: function() {
+ get: function() { // eslint-disable-line getter-return
if (this._handle) {
return this[kLastWriteQueueSize] + this.writableLength;
}
diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js
index 9abbeec199..a474fd56e4 100644
--- a/test/parallel/test-util-inspect.js
+++ b/test/parallel/test-util-inspect.js
@@ -289,11 +289,11 @@ assert.strictEqual(
// Dynamic properties.
{
assert.strictEqual(
- util.inspect({ get readonly() {} }),
+ util.inspect({ get readonly() { return 1; } }),
'{ readonly: [Getter] }');
assert.strictEqual(
- util.inspect({ get readwrite() {}, set readwrite(val) {} }),
+ util.inspect({ get readwrite() { return 1; }, set readwrite(val) {} }),
'{ readwrite: [Getter/Setter] }');
assert.strictEqual(