Skip to content

Commit 31578ab

Browse files
aduh95danielleadams
authored andcommitted
lib: add trailing commas to more internal files
PR-URL: #46811 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Debadree Chatterjee <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent 5f647fb commit 31578ab

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+185
-190
lines changed

lib/.eslintrc.yaml

+4-9
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,8 @@ globals:
251251
primordials: false
252252
overrides:
253253
- files:
254-
- ./*/promises.js
255-
- ./_stream_*.js
256-
- ./_tls_common.js
257-
- ./assert/*.js
254+
- ./*/*.js
255+
- ./_*.js
258256
- ./child_process.js
259257
- ./cluster.js
260258
- ./console.js
@@ -276,7 +274,7 @@ overrides:
276274
- ./internal/js_stream_socket.js
277275
- ./internal/mime.js
278276
- ./internal/modules/*.js
279-
- ./internal/per_context/messageport.js
277+
- ./internal/per_context/*.js
280278
- ./internal/perf/*.js
281279
- ./internal/policy/*.js
282280
- ./internal/priority_queue.js
@@ -285,7 +283,7 @@ overrides:
285283
- ./internal/readme.md
286284
- ./internal/repl.js
287285
- ./internal/repl/*.js
288-
- ./internal/source_map/prepare_stack_trace.js
286+
- ./internal/source_map/*.js
289287
- ./internal/streams/*.js
290288
- ./internal/structured_clone.js
291289
- ./internal/test/*.js
@@ -298,15 +296,12 @@ overrides:
298296
- ./internal/webidl.js
299297
- ./internal/webstreams/*.js
300298
- ./module.js
301-
- ./path/*.js
302299
- ./process.js
303300
- ./punycode.js
304301
- ./repl.js
305-
- ./stream/*.js
306302
- ./sys.js
307303
- ./test.js
308304
- ./tls.js
309305
- ./url.js
310-
- ./util/*.js
311306
rules:
312307
comma-dangle: [error, always-multiline]

lib/_http_agent.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ Agent.prototype.addRequest = function addRequest(req, options, port/* legacy */,
244244
__proto__: null,
245245
host: options,
246246
port,
247-
localAddress
247+
localAddress,
248248
};
249249
}
250250

@@ -533,5 +533,5 @@ function asyncResetHandle(socket) {
533533

534534
module.exports = {
535535
Agent,
536-
globalAgent: new Agent()
536+
globalAgent: new Agent(),
537537
};

lib/_http_client.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const {
5858
const {
5959
kUniqueHeaders,
6060
parseUniqueHeadersOption,
61-
OutgoingMessage
61+
OutgoingMessage,
6262
} = require('_http_outgoing');
6363
const Agent = require('_http_agent');
6464
const { Buffer } = require('buffer');
@@ -78,7 +78,7 @@ const {
7878
ERR_INVALID_ARG_TYPE,
7979
ERR_INVALID_HTTP_TOKEN,
8080
ERR_INVALID_PROTOCOL,
81-
ERR_UNESCAPED_CHARACTERS
81+
ERR_UNESCAPED_CHARACTERS,
8282
} = codes;
8383
const {
8484
validateInteger,
@@ -87,7 +87,7 @@ const {
8787
const { getTimerDuration } = require('internal/timers');
8888
const {
8989
DTRACE_HTTP_CLIENT_REQUEST,
90-
DTRACE_HTTP_CLIENT_RESPONSE
90+
DTRACE_HTTP_CLIENT_RESPONSE,
9191
} = require('internal/dtrace');
9292

9393
const {
@@ -650,7 +650,7 @@ function parserOnIncomingClient(res, shouldKeepAlive) {
650650
httpVersionMajor: res.httpVersionMajor,
651651
httpVersionMinor: res.httpVersionMinor,
652652
headers: res.headers,
653-
rawHeaders: res.rawHeaders
653+
rawHeaders: res.rawHeaders,
654654
});
655655

656656
return 1; // Skip body but don't treat as Upgrade.
@@ -977,5 +977,5 @@ ClientRequest.prototype.clearTimeout = function clearTimeout(cb) {
977977
};
978978

979979
module.exports = {
980-
ClientRequest
980+
ClientRequest,
981981
};

lib/_http_common.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const incoming = require('_http_incoming');
3737
const {
3838
IncomingMessage,
3939
readStart,
40-
readStop
40+
readStop,
4141
} = incoming;
4242

4343
const kIncomingMessage = Symbol('IncomingMessage');

lib/_http_incoming.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const {
2727
StringPrototypeCharCodeAt,
2828
StringPrototypeSlice,
2929
StringPrototypeToLowerCase,
30-
Symbol
30+
Symbol,
3131
} = primordials;
3232

3333
const { Readable, finished } = require('stream');
@@ -55,7 +55,7 @@ function IncomingMessage(socket) {
5555

5656
if (socket) {
5757
streamOptions = {
58-
highWaterMark: socket.readableHighWaterMark
58+
highWaterMark: socket.readableHighWaterMark,
5959
};
6060
}
6161

@@ -104,7 +104,7 @@ ObjectDefineProperty(IncomingMessage.prototype, 'connection', {
104104
},
105105
set: function(val) {
106106
this.socket = val;
107-
}
107+
},
108108
});
109109

110110
ObjectDefineProperty(IncomingMessage.prototype, 'headers', {
@@ -124,7 +124,7 @@ ObjectDefineProperty(IncomingMessage.prototype, 'headers', {
124124
},
125125
set: function(val) {
126126
this[kHeaders] = val;
127-
}
127+
},
128128
});
129129

130130
ObjectDefineProperty(IncomingMessage.prototype, 'headersDistinct', {
@@ -144,7 +144,7 @@ ObjectDefineProperty(IncomingMessage.prototype, 'headersDistinct', {
144144
},
145145
set: function(val) {
146146
this[kHeadersDistinct] = val;
147-
}
147+
},
148148
});
149149

150150
ObjectDefineProperty(IncomingMessage.prototype, 'trailers', {
@@ -164,7 +164,7 @@ ObjectDefineProperty(IncomingMessage.prototype, 'trailers', {
164164
},
165165
set: function(val) {
166166
this[kTrailers] = val;
167-
}
167+
},
168168
});
169169

170170
ObjectDefineProperty(IncomingMessage.prototype, 'trailersDistinct', {
@@ -184,7 +184,7 @@ ObjectDefineProperty(IncomingMessage.prototype, 'trailersDistinct', {
184184
},
185185
set: function(val) {
186186
this[kTrailersDistinct] = val;
187-
}
187+
},
188188
});
189189

190190
IncomingMessage.prototype.setTimeout = function setTimeout(msecs, callback) {
@@ -452,5 +452,5 @@ function onError(self, error, cb) {
452452
module.exports = {
453453
IncomingMessage,
454454
readStart,
455-
readStop
455+
readStop,
456456
};

lib/_http_outgoing.js

+17-17
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const {
5353
} = require('_http_common');
5454
const {
5555
defaultTriggerAsyncIdScope,
56-
symbols: { async_id_symbol }
56+
symbols: { async_id_symbol },
5757
} = require('internal/async_hooks');
5858
const {
5959
codes: {
@@ -70,9 +70,9 @@ const {
7070
ERR_STREAM_ALREADY_FINISHED,
7171
ERR_STREAM_WRITE_AFTER_END,
7272
ERR_STREAM_NULL_VALUES,
73-
ERR_STREAM_DESTROYED
73+
ERR_STREAM_DESTROYED,
7474
},
75-
hideStackFrames
75+
hideStackFrames,
7676
} = require('internal/errors');
7777
const { validateString } = require('internal/validators');
7878
const { isUint8Array } = require('internal/util/types');
@@ -177,36 +177,36 @@ ObjectDefineProperty(OutgoingMessage.prototype, 'writableFinished', {
177177
this.outputSize === 0 &&
178178
(!this.socket || this.socket.writableLength === 0)
179179
);
180-
}
180+
},
181181
});
182182

183183
ObjectDefineProperty(OutgoingMessage.prototype, 'writableObjectMode', {
184184
__proto__: null,
185185
get() {
186186
return false;
187-
}
187+
},
188188
});
189189

190190
ObjectDefineProperty(OutgoingMessage.prototype, 'writableLength', {
191191
__proto__: null,
192192
get() {
193193
return this.outputSize + (this.socket ? this.socket.writableLength : 0);
194-
}
194+
},
195195
});
196196

197197
ObjectDefineProperty(OutgoingMessage.prototype, 'writableHighWaterMark', {
198198
__proto__: null,
199199
get() {
200200
return this.socket ? this.socket.writableHighWaterMark : HIGH_WATER_MARK;
201-
}
201+
},
202202
});
203203

204204
ObjectDefineProperty(OutgoingMessage.prototype, 'writableCorked', {
205205
__proto__: null,
206206
get() {
207207
const corked = this.socket ? this.socket.writableCorked : 0;
208208
return corked + this[kCorked];
209-
}
209+
},
210210
});
211211

212212
ObjectDefineProperty(OutgoingMessage.prototype, '_headers', {
@@ -227,7 +227,7 @@ ObjectDefineProperty(OutgoingMessage.prototype, '_headers', {
227227
headers[StringPrototypeToLowerCase(name)] = [name, val[name]];
228228
}
229229
}
230-
}, 'OutgoingMessage.prototype._headers is deprecated', 'DEP0066')
230+
}, 'OutgoingMessage.prototype._headers is deprecated', 'DEP0066'),
231231
});
232232

233233
ObjectDefineProperty(OutgoingMessage.prototype, 'connection', {
@@ -237,7 +237,7 @@ ObjectDefineProperty(OutgoingMessage.prototype, 'connection', {
237237
},
238238
set: function(val) {
239239
this.socket = val;
240-
}
240+
},
241241
});
242242

243243
ObjectDefineProperty(OutgoingMessage.prototype, '_headerNames', {
@@ -272,7 +272,7 @@ ObjectDefineProperty(OutgoingMessage.prototype, '_headerNames', {
272272
header[0] = val[keys[i]];
273273
}
274274
}
275-
}, 'OutgoingMessage.prototype._headerNames is deprecated', 'DEP0066')
275+
}, 'OutgoingMessage.prototype._headerNames is deprecated', 'DEP0066'),
276276
});
277277

278278

@@ -368,7 +368,7 @@ OutgoingMessage.prototype._send = function _send(data, encoding, callback, byteL
368368
this.outputData.unshift({
369369
data: header,
370370
encoding: 'latin1',
371-
callback: null
371+
callback: null,
372372
});
373373
this.outputSize += header.length;
374374
this._onPendingData(header.length);
@@ -419,7 +419,7 @@ function _storeHeader(firstLine, headers) {
419419
date: false,
420420
expect: false,
421421
trailer: false,
422-
header: firstLine
422+
header: firstLine,
423423
};
424424

425425
if (headers) {
@@ -806,19 +806,19 @@ ObjectDefineProperty(OutgoingMessage.prototype, 'headersSent', {
806806
__proto__: null,
807807
configurable: true,
808808
enumerable: true,
809-
get: function() { return !!this._header; }
809+
get: function() { return !!this._header; },
810810
});
811811

812812
ObjectDefineProperty(OutgoingMessage.prototype, 'writableEnded', {
813813
__proto__: null,
814-
get: function() { return this.finished; }
814+
get: function() { return this.finished; },
815815
});
816816

817817
ObjectDefineProperty(OutgoingMessage.prototype, 'writableNeedDrain', {
818818
__proto__: null,
819819
get: function() {
820820
return !this.destroyed && !this.finished && this[kNeedDrain];
821-
}
821+
},
822822
});
823823

824824
const crlf_buf = Buffer.from('\r\n');
@@ -1171,5 +1171,5 @@ module.exports = {
11711171
parseUniqueHeadersOption,
11721172
validateHeaderName,
11731173
validateHeaderValue,
1174-
OutgoingMessage
1174+
OutgoingMessage,
11751175
};

0 commit comments

Comments
 (0)