tools: enable no-useless-return eslint rule · nodejs/node@258eeaa · GitHub
Skip to content

Commit 258eeaa

Browse files
cjihrigevanlucas
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 ac52923 commit 258eeaa

6 files changed

Lines changed: 5 additions & 7 deletions

File tree

.eslintrc.yaml

Lines changed: 1 addition & 0 deletions

doc/api/errors.md

Lines changed: 1 addition & 0 deletions
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) => {

doc/api/stream.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,6 +1566,7 @@ unexpected and inconsistent behavior depending on whether the stream is
15661566
operating in flowing or paused mode. Using the `'error'` event ensures
15671567
consistent and predictable handling of errors.
15681568

1569+
<!-- eslint-disable no-useless-return -->
15691570
```js
15701571
const Readable = require('stream').Readable;
15711572

lib/dgram.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ function enqueue(self, toEnqueue) {
282282
self.once('listening', clearQueue);
283283
}
284284
self._queue.push(toEnqueue);
285-
return;
286285
}
287286

288287

test/parallel/test-require-symlink.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ if (common.isWindows) {
3030
if (err || !o.includes('SeCreateSymbolicLinkPrivilege')) {
3131
common.skip('insufficient privileges');
3232
return;
33-
} else {
34-
test();
3533
}
34+
35+
test();
3636
});
3737
} else {
3838
test();

tools/doc/json.js

Lines changed: 0 additions & 4 deletions

0 commit comments

Comments
 (0)