From f20ed49b5e8c34c7f9c6a8f2a5c845832621e44e Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 4 Jul 2017 17:59:36 -0700 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/14835 PR-URL: https://github.com/nodejs/node/pull/14078 Reviewed-By: Refael Ackermann Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig --- lib/fs.js | 5 ++--- lib/internal/child_process.js | 4 ++-- lib/url.js | 6 ++++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/fs.js b/lib/fs.js index 3f3d27c40719ea..08a7d4b63f0ead 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -1417,9 +1417,8 @@ function FSWatcher() { if (status < 0) { self._handle.close(); const error = !filename ? - errnoException(status, 'Error watching file for changes:') : - errnoException(status, - `Error watching file ${filename} for changes:`); + errnoException(status, 'Error watching file for changes:') : + errnoException(status, `Error watching file ${filename} for changes:`); error.filename = filename; self.emit('error', error); } else { diff --git a/lib/internal/child_process.js b/lib/internal/child_process.js index f11d81c6d90b6b..af69bb5b289872 100644 --- a/lib/internal/child_process.js +++ b/lib/internal/child_process.js @@ -874,8 +874,8 @@ function _validateStdio(stdio, sync) { } else if (getHandleWrapType(stdio) || getHandleWrapType(stdio.handle) || getHandleWrapType(stdio._handle)) { var handle = getHandleWrapType(stdio) ? - stdio : - getHandleWrapType(stdio.handle) ? stdio.handle : stdio._handle; + stdio : + getHandleWrapType(stdio.handle) ? stdio.handle : stdio._handle; acc.push({ type: 'wrap', diff --git a/lib/url.js b/lib/url.js index e69786403449e1..cddc4be0e6e480 100644 --- a/lib/url.js +++ b/lib/url.js @@ -567,9 +567,11 @@ Url.prototype.format = function() { if (this.host) { host = auth + this.host; } else if (this.hostname) { - host = auth + (this.hostname.indexOf(':') === -1 ? + host = auth + ( + this.hostname.indexOf(':') === -1 ? this.hostname : - '[' + this.hostname + ']'); + '[' + this.hostname + ']' + ); if (this.port) { host += ':' + this.port; }