Skip to content

Commit

Permalink
lib: use consistent indentation for ternaries
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Trott authored and MylesBorins committed Sep 5, 2017
1 parent 8b7c4fc commit f20ed49
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
5 changes: 2 additions & 3 deletions lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions lib/internal/child_process.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
6 changes: 4 additions & 2 deletions lib/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit f20ed49

Please sign in to comment.