GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — tools: enable no-else-return lint rule · nodejs/node@9119344

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .eslintrc.js
  • benchmark
    • es
      • spread-bench.js
    • scatter.js
  • lib
    • _http_incoming.js
    • _stream_readable.js
    • _stream_writable.js
    • _tls_wrap.js
    • dns.js
    • events.js
    • fs.js
    • internal
      • crypto
        • keys.js
        • sig.js
      • errors.js
      • fs
        • streams.js
        • utils.js
      • modules/esm
        • get_source.js
        • resolve.js
      • policy
        • manifest.js
      • source_map
        • source_map.js
        • source_map_cache.js
      • streams
        • pipeline.js
      • url.js
    • net.js
    • repl.js
    • v8.js
    • vm.js
    • zlib.js
  • test
    • addons/stringbytes-external-exceed-max
      • test-stringbytes-external-exceed-max-by-1-utf8.js
    • async-hooks
      • init-hooks.js
    • common
      • dns.js
      • index.js
      • inspector-helper.js
      • shared-lib-util.js
      • wpt.js
    • parallel
      • test-fs-mkdir-mode-mask.js
      • test-fs-utimes.js
      • test-net-pingpong.js
      • test-stream2-readable-empty-buffer-no-eof.js
      • test-trace-events-api.js
    • pummel
      • test-net-pingpong.js
  • tools
    • doc
      • json.js
    • test-npm-package.js

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.eslintrc.js‎

Copy file name to clipboardExpand all lines: .eslintrc.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ module.exports = {
129129
'no-dupe-else-if': 'error',
130130
'no-duplicate-case': 'error',
131131
'no-duplicate-imports': 'error',
132+
'no-else-return': ['error', { allowElseIf: true }],
132133
'no-empty-character-class': 'error',
133134
'no-ex-assign': 'error',
134135
'no-extra-boolean-cast': 'error',
Collapse file

‎benchmark/es/spread-bench.js‎

Copy file name to clipboardExpand all lines: benchmark/es/spread-bench.js
+3-4Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@ function makeTest(count, rest) {
1616
return function test(...args) {
1717
assert.strictEqual(count, args.length);
1818
};
19-
} else {
20-
return function test() {
21-
assert.strictEqual(count, arguments.length);
22-
};
2319
}
20+
return function test() {
21+
assert.strictEqual(count, arguments.length);
22+
};
2423
}
2524

2625
function main({ n, context, count, rest, method }) {
Collapse file

‎benchmark/scatter.js‎

Copy file name to clipboardExpand all lines: benchmark/scatter.js
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@ let printHeader = true;
3030
function csvEncodeValue(value) {
3131
if (typeof value === 'number') {
3232
return value.toString();
33-
} else {
34-
return `"${value.replace(/"/g, '""')}"`;
3533
}
34+
return `"${value.replace(/"/g, '""')}"`;
3635
}
3736

3837
(function recursive(i) {
Collapse file

‎lib/_http_incoming.js‎

Copy file name to clipboardExpand all lines: lib/_http_incoming.js
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,8 @@ function matchKnownFields(field, lowercased) {
248248
}
249249
if (lowercased) {
250250
return '\u0000' + field;
251-
} else {
252-
return matchKnownFields(field.toLowerCase(), true);
253251
}
252+
return matchKnownFields(field.toLowerCase(), true);
254253
}
255254
// Add the given (field, value) pair to the message
256255
//
Collapse file

‎lib/_stream_readable.js‎

Copy file name to clipboardExpand all lines: lib/_stream_readable.js
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,7 @@ function howMuchToRead(n, state) {
372372
// Only flow one buffer at a time.
373373
if (state.flowing && state.length)
374374
return state.buffer.first().length;
375-
else
376-
return state.length;
375+
return state.length;
377376
}
378377
if (n <= state.length)
379378
return n;
Collapse file

‎lib/_stream_writable.js‎

Copy file name to clipboardExpand all lines: lib/_stream_writable.js
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,9 @@ Writable.prototype.write = function(chunk, encoding, cb) {
298298
process.nextTick(cb, err);
299299
errorOrDestroy(this, err, true);
300300
return false;
301-
} else {
302-
state.pendingcb++;
303-
return writeOrBuffer(this, state, chunk, encoding, cb);
304301
}
302+
state.pendingcb++;
303+
return writeOrBuffer(this, state, chunk, encoding, cb);
305304
};
306305

307306
Writable.prototype.cork = function() {
Collapse file

‎lib/_tls_wrap.js‎

Copy file name to clipboardExpand all lines: lib/_tls_wrap.js
+5-6Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1503,13 +1503,12 @@ function onConnectSecure() {
15031503
if (options.rejectUnauthorized) {
15041504
this.destroy(verifyError);
15051505
return;
1506-
} else {
1507-
debug('client emit secureConnect. rejectUnauthorized: %s, ' +
1508-
'authorizationError: %s', options.rejectUnauthorized,
1509-
this.authorizationError);
1510-
this.secureConnecting = false;
1511-
this.emit('secureConnect');
15121506
}
1507+
debug('client emit secureConnect. rejectUnauthorized: %s, ' +
1508+
'authorizationError: %s', options.rejectUnauthorized,
1509+
this.authorizationError);
1510+
this.secureConnecting = false;
1511+
this.emit('secureConnect');
15131512
} else {
15141513
this.authorized = true;
15151514
debug('client emit secureConnect. authorized:', this.authorized);
Collapse file

‎lib/dns.js‎

Copy file name to clipboardExpand all lines: lib/dns.js
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,8 @@ function resolve(hostname, rrtype, callback) {
261261

262262
if (typeof resolver === 'function') {
263263
return resolver.call(this, hostname, callback);
264-
} else {
265-
throw new ERR_INVALID_OPT_VALUE('rrtype', rrtype);
266264
}
265+
throw new ERR_INVALID_OPT_VALUE('rrtype', rrtype);
267266
}
268267

269268
function defaultResolverSetServers(servers) {
Collapse file

‎lib/events.js‎

Copy file name to clipboardExpand all lines: lib/events.js
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -577,9 +577,8 @@ EventEmitter.prototype.rawListeners = function rawListeners(type) {
577577
EventEmitter.listenerCount = function(emitter, type) {
578578
if (typeof emitter.listenerCount === 'function') {
579579
return emitter.listenerCount(type);
580-
} else {
581-
return listenerCount.call(emitter, type);
582580
}
581+
return listenerCount.call(emitter, type);
583582
};
584583

585584
EventEmitter.prototype.listenerCount = listenerCount;
Collapse file

‎lib/fs.js‎

Copy file name to clipboardExpand all lines: lib/fs.js
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1545,9 +1545,8 @@ function encodeRealpathResult(result, options) {
15451545
const asBuffer = Buffer.from(result);
15461546
if (options.encoding === 'buffer') {
15471547
return asBuffer;
1548-
} else {
1549-
return asBuffer.toString(options.encoding);
15501548
}
1549+
return asBuffer.toString(options.encoding);
15511550
}
15521551

15531552
// Finds the next portion of a (partial) path, up to the next path delimiter

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.