Browse Source

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 <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
v6.x
Rich Trott 8 years ago
committed by Myles Borins
parent
commit
f20ed49b5e
No known key found for this signature in database GPG Key ID: 933B01F40B5CA946
  1. 5
      lib/fs.js
  2. 4
      lib/internal/child_process.js
  3. 6
      lib/url.js

5
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 {

4
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',

6
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;
}

Loading…
Cancel
Save