Skip to content

Commit f20ed49

Browse files
TrottMylesBorins
authored andcommitted
lib: use consistent indentation for ternaries
In anticipation of stricter linting for indentation issues, modify ternary operators in lib that do not conform with the expected ESLint settings. Backport-PR-URL: #14835 PR-URL: #14078 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 8b7c4fc commit f20ed49

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

‎lib/fs.js‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,9 +1417,8 @@ function FSWatcher() {
14171417
if(status<0){
14181418
self._handle.close();
14191419
consterror=!filename ?
1420-
errnoException(status,'Error watching file for changes:') :
1421-
errnoException(status,
1422-
`Error watching file ${filename} for changes:`);
1420+
errnoException(status,'Error watching file for changes:') :
1421+
errnoException(status,`Error watching file ${filename} for changes:`);
14231422
error.filename=filename;
14241423
self.emit('error',error);
14251424
}else{

‎lib/internal/child_process.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -874,8 +874,8 @@ function _validateStdio(stdio, sync) {
874874
}elseif(getHandleWrapType(stdio)||getHandleWrapType(stdio.handle)||
875875
getHandleWrapType(stdio._handle)){
876876
varhandle=getHandleWrapType(stdio) ?
877-
stdio :
878-
getHandleWrapType(stdio.handle) ? stdio.handle : stdio._handle;
877+
stdio :
878+
getHandleWrapType(stdio.handle) ? stdio.handle : stdio._handle;
879879

880880
acc.push({
881881
type: 'wrap',

‎lib/url.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,9 +567,11 @@ Url.prototype.format = function() {
567567
if(this.host){
568568
host=auth+this.host;
569569
}elseif(this.hostname){
570-
host=auth+(this.hostname.indexOf(':')===-1 ?
570+
host=auth+(
571+
this.hostname.indexOf(':')===-1 ?
571572
this.hostname :
572-
'['+this.hostname+']');
573+
'['+this.hostname+']'
574+
);
573575
if(this.port){
574576
host+=':'+this.port;
575577
}

0 commit comments

Comments
 (0)