lib: use consistent indentation for ternaries · nodejs/node@0764255 · GitHub
Skip to content

Commit 0764255

Browse files
Trottaddaleax
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. 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 e25c5ef commit 0764255

6 files changed

Lines changed: 17 additions & 20 deletions

File tree

lib/_stream_readable.js

Lines changed: 1 addition & 3 deletions

lib/cluster.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,5 @@
2121

2222
'use strict';
2323

24-
module.exports = ('NODE_UNIQUE_ID' in process.env) ?
25-
require('internal/cluster/child') :
26-
require('internal/cluster/master');
24+
const childOrMaster = 'NODE_UNIQUE_ID' in process.env ? 'child' : 'master';
25+
module.exports = require(`internal/cluster/${childOrMaster}`);

lib/fs.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,9 +1357,8 @@ function FSWatcher() {
13571357
if (status < 0) {
13581358
self._handle.close();
13591359
const error = !filename ?
1360-
errnoException(status, 'Error watching file for changes:') :
1361-
errnoException(status,
1362-
`Error watching file ${filename} for changes:`);
1360+
errnoException(status, 'Error watching file for changes:') :
1361+
errnoException(status, `Error watching file ${filename} for changes:`);
13631362
error.filename = filename;
13641363
self.emit('error', error);
13651364
} else {

lib/internal/bootstrap_node.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,9 @@
275275
enumerable: true,
276276
get: function() {
277277
if (!console) {
278-
console = originalConsole === undefined ?
279-
NativeModule.require('console') :
280-
installInspectorConsole(originalConsole);
278+
console = (originalConsole === undefined) ?
279+
NativeModule.require('console') :
280+
installInspectorConsole(originalConsole);
281281
}
282282
return console;
283283
}

lib/internal/child_process.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -875,8 +875,8 @@ function _validateStdio(stdio, sync) {
875875
} else if (getHandleWrapType(stdio) || getHandleWrapType(stdio.handle) ||
876876
getHandleWrapType(stdio._handle)) {
877877
var handle = getHandleWrapType(stdio) ?
878-
stdio :
879-
getHandleWrapType(stdio.handle) ? stdio.handle : stdio._handle;
878+
stdio :
879+
getHandleWrapType(stdio.handle) ? stdio.handle : stdio._handle;
880880

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

lib/url.js

Lines changed: 7 additions & 6 deletions

0 commit comments

Comments
 (0)