Skip to content

Commit

Permalink
tools: enable no-useless-return eslint rule
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
cjihrig authored and MylesBorins committed May 18, 2017
1 parent 3cce181 commit b920c5d
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 8 deletions.
1 change: 1 addition & 0 deletions .eslintrc.yaml
Expand Up @@ -45,6 +45,7 @@ rules:
no-unused-labels: 2
no-useless-call: 2
no-useless-escape: 2
no-useless-return: 2
no-void: 2
no-with: 2

Expand Down
1 change: 1 addition & 0 deletions doc/api/errors.md
Expand Up @@ -64,6 +64,7 @@ Errors that occur within _Asynchronous APIs_ may be reported in multiple ways:
argument is not `null` and is an instance of `Error`, then an error occurred
that should be handled.

<!-- eslint-disable no-useless-return -->
```js
const fs = require('fs');
fs.readFile('a file that does not exist', (err, data) => {
Expand Down
1 change: 1 addition & 0 deletions doc/api/stream.md
Expand Up @@ -1548,6 +1548,7 @@ unexpected and inconsistent behavior depending on whether the stream is
operating in flowing or paused mode. Using the `'error'` event ensures
consistent and predictable handling of errors.

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

Expand Down
1 change: 0 additions & 1 deletion lib/dgram.js
Expand Up @@ -286,7 +286,6 @@ function enqueue(self, toEnqueue) {
self.once('listening', clearQueue);
}
self._queue.push(toEnqueue);
return;
}


Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-fs-symlink.js
Expand Up @@ -14,7 +14,6 @@ if (common.isWindows) {
exec('whoami /priv', function(err, o) {
if (err || !o.includes('SeCreateSymbolicLinkPrivilege')) {
common.skip('insufficient privileges');
return;
}
});
}
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-require-symlink.js
Expand Up @@ -29,9 +29,9 @@ if (common.isWindows) {
if (err || !o.includes('SeCreateSymbolicLinkPrivilege')) {
common.skip('insufficient privileges');
return;
} else {
test();
}

test();
});
} else {
test();
Expand Down
4 changes: 0 additions & 4 deletions tools/doc/json.js
Expand Up @@ -222,7 +222,6 @@ function processList(section) {
current.options.push(n);
current = n;
}
return;
} else if (type === 'list_item_end') {
if (!current) {
throw new Error('invalid list - end without current item\n' +
Expand Down Expand Up @@ -499,9 +498,6 @@ function finishSection(section, parent) {
parent[k] = parent[k].concat(section[k]);
} else if (!parent[k]) {
parent[k] = section[k];
} else {
// parent already has, and it's not an array.
return;
}
}
});
Expand Down

0 comments on commit b920c5d

Please sign in to comment.