Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b920c5d

Browse filesBrowse files
cjihrigMylesBorins
authored andcommitted
tools: enable no-useless-return eslint rule
PR-URL: #12577 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
1 parent 3cce181 commit b920c5d
Copy full SHA for b920c5d

File tree

Expand file treeCollapse file tree

7 files changed

+5
-8
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

7 files changed

+5
-8
lines changed
Open diff view settings
Collapse file

‎.eslintrc.yaml‎

Copy file name to clipboardExpand all lines: .eslintrc.yaml
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ rules:
4545
no-unused-labels: 2
4646
no-useless-call: 2
4747
no-useless-escape: 2
48+
no-useless-return: 2
4849
no-void: 2
4950
no-with: 2
5051

Collapse file

‎doc/api/errors.md‎

Copy file name to clipboardExpand all lines: doc/api/errors.md
+1Lines changed: 1 addition & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ Errors that occur within _Asynchronous APIs_ may be reported in multiple ways:
6464
argument is not `null` and is an instance of `Error`, then an error occurred
6565
that should be handled.
6666

67+
<!-- eslint-disable no-useless-return -->
6768
```js
6869
const fs = require('fs');
6970
fs.readFile('a file that does not exist', (err, data) => {
Collapse file

‎doc/api/stream.md‎

Copy file name to clipboardExpand all lines: doc/api/stream.md
+1Lines changed: 1 addition & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1548,6 +1548,7 @@ unexpected and inconsistent behavior depending on whether the stream is
15481548
operating in flowing or paused mode. Using the `'error'` event ensures
15491549
consistent and predictable handling of errors.
15501550

1551+
<!-- eslint-disable no-useless-return -->
15511552
```js
15521553
const Readable = require('stream').Readable;
15531554

Collapse file

‎lib/dgram.js‎

Copy file name to clipboardExpand all lines: lib/dgram.js
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,6 @@ function enqueue(self, toEnqueue) {
286286
self.once('listening', clearQueue);
287287
}
288288
self._queue.push(toEnqueue);
289-
return;
290289
}
291290

292291

Collapse file

‎test/parallel/test-fs-symlink.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-symlink.js
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ if (common.isWindows) {
1414
exec('whoami /priv', function(err, o) {
1515
if (err || !o.includes('SeCreateSymbolicLinkPrivilege')) {
1616
common.skip('insufficient privileges');
17-
return;
1817
}
1918
});
2019
}
Collapse file

‎test/parallel/test-require-symlink.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-require-symlink.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ if (common.isWindows) {
2929
if (err || !o.includes('SeCreateSymbolicLinkPrivilege')) {
3030
common.skip('insufficient privileges');
3131
return;
32-
} else {
33-
test();
3432
}
33+
34+
test();
3535
});
3636
} else {
3737
test();
Collapse file

‎tools/doc/json.js‎

Copy file name to clipboardExpand all lines: tools/doc/json.js
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ function processList(section) {
222222
current.options.push(n);
223223
current = n;
224224
}
225-
return;
226225
} else if (type === 'list_item_end') {
227226
if (!current) {
228227
throw new Error('invalid list - end without current item\n' +
@@ -499,9 +498,6 @@ function finishSection(section, parent) {
499498
parent[k] = parent[k].concat(section[k]);
500499
} else if (!parent[k]) {
501500
parent[k] = section[k];
502-
} else {
503-
// parent already has, and it's not an array.
504-
return;
505501
}
506502
}
507503
});

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.