Skip to content

tools: enable no-useless-return eslint rule #12577

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -1566,6 +1566,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
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@ function enqueue(self, toEnqueue) {
self.once('listening', onListenSuccess);
}
self._queue.push(toEnqueue);
return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

}


Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-require-symlink.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,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
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,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 @@ -516,9 +515,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