Skip to content

Commit b920c5d

Browse files
cjihrigMylesBorins
authored andcommitted
tools: enable no-useless-return eslint rule
PR-URL: #12577 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Teddy Katz <[email protected]> Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
1 parent 3cce181 commit b920c5d

File tree

7 files changed

+5
-8
lines changed

7 files changed

+5
-8
lines changed

‎.eslintrc.yaml‎

Lines 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

‎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
constfs=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
@@ -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
constReadable=require('stream').Readable;
15531554

‎lib/dgram.js‎

Lines 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

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

Lines 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
}

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

Lines 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();

‎tools/doc/json.js‎

Lines 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
}elseif(type==='list_item_end'){
227226
if(!current){
228227
thrownewError('invalid list - end without current item\n'+
@@ -499,9 +498,6 @@ function finishSection(section, parent){
499498
parent[k]=parent[k].concat(section[k]);
500499
}elseif(!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)