Skip to content

Commit e8c0e0f

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 <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 9320db0 commit e8c0e0f

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

lib/fs.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1417,9 +1417,8 @@ function FSWatcher() {
14171417
if (status < 0) {
14181418
self._handle.close();
14191419
const error = !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

+2-2
Original file line numberDiff line numberDiff line change
@@ -874,8 +874,8 @@ function _validateStdio(stdio, sync) {
874874
} else if (getHandleWrapType(stdio) || getHandleWrapType(stdio.handle) ||
875875
getHandleWrapType(stdio._handle)) {
876876
var handle = 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

+4-2
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
} else if (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)