Skip to content

Commit 1848fe3

Browse files
committed
lib: add trailing commas to more internal files
1 parent 0f10c87 commit 1848fe3

Some content is hidden

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

43 files changed

+171
-176
lines changed

lib/.eslintrc.yaml

+4-9
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,8 @@ globals:
263263
primordials: false
264264
overrides:
265265
- files:
266-
- ./*/promises.js
267-
- ./_stream_*.js
268-
- ./_tls_common.js
269-
- ./assert/*.js
266+
- ./*/*.js
267+
- ./_*.js
270268
- ./child_process.js
271269
- ./cluster.js
272270
- ./console.js
@@ -290,7 +288,7 @@ overrides:
290288
- ./internal/js_stream_socket.js
291289
- ./internal/mime.js
292290
- ./internal/modules/*.js
293-
- ./internal/per_context/messageport.js
291+
- ./internal/per_context/*.js
294292
- ./internal/perf/*.js
295293
- ./internal/policy/*.js
296294
- ./internal/priority_queue.js
@@ -299,7 +297,7 @@ overrides:
299297
- ./internal/readme.md
300298
- ./internal/repl.js
301299
- ./internal/repl/*.js
302-
- ./internal/source_map/prepare_stack_trace.js
300+
- ./internal/source_map/*.js
303301
- ./internal/streams/*.js
304302
- ./internal/structured_clone.js
305303
- ./internal/test/*.js
@@ -312,15 +310,12 @@ overrides:
312310
- ./internal/webidl.js
313311
- ./internal/webstreams/*.js
314312
- ./module.js
315-
- ./path/*.js
316313
- ./process.js
317314
- ./punycode.js
318315
- ./repl.js
319-
- ./stream/*.js
320316
- ./sys.js
321317
- ./test.js
322318
- ./tls.js
323319
- ./url.js
324-
- ./util/*.js
325320
rules:
326321
comma-dangle: [error, always-multiline]

lib/_http_agent.js

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

@@ -551,5 +551,5 @@ function asyncResetHandle(socket) {
551551

552552
module.exports = {
553553
Agent,
554-
globalAgent: new Agent({ keepAlive: true, scheduling: 'lifo', timeout: 5000 })
554+
globalAgent: new Agent({ keepAlive: true, scheduling: 'lifo', timeout: 5000 }),
555555
};

lib/_http_client.js

+4-4
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,
@@ -644,7 +644,7 @@ function parserOnIncomingClient(res, shouldKeepAlive) {
644644
httpVersionMajor: res.httpVersionMajor,
645645
httpVersionMinor: res.httpVersionMinor,
646646
headers: res.headers,
647-
rawHeaders: res.rawHeaders
647+
rawHeaders: res.rawHeaders,
648648
});
649649

650650
return 1; // Skip body but don't treat as Upgrade.
@@ -970,5 +970,5 @@ ClientRequest.prototype.clearTimeout = function clearTimeout(cb) {
970970
};
971971

972972
module.exports = {
973-
ClientRequest
973+
ClientRequest,
974974
};

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
@@ -52,7 +52,7 @@ const {
5252
} = require('_http_common');
5353
const {
5454
defaultTriggerAsyncIdScope,
55-
symbols: { async_id_symbol }
55+
symbols: { async_id_symbol },
5656
} = require('internal/async_hooks');
5757
const {
5858
codes: {
@@ -69,9 +69,9 @@ const {
6969
ERR_STREAM_ALREADY_FINISHED,
7070
ERR_STREAM_WRITE_AFTER_END,
7171
ERR_STREAM_NULL_VALUES,
72-
ERR_STREAM_DESTROYED
72+
ERR_STREAM_DESTROYED,
7373
},
74-
hideStackFrames
74+
hideStackFrames,
7575
} = require('internal/errors');
7676
const { validateString } = require('internal/validators');
7777
const { isUint8Array } = require('internal/util/types');
@@ -176,36 +176,36 @@ ObjectDefineProperty(OutgoingMessage.prototype, 'writableFinished', {
176176
this.outputSize === 0 &&
177177
(!this.socket || this.socket.writableLength === 0)
178178
);
179-
}
179+
},
180180
});
181181

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

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

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

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

211211
ObjectDefineProperty(OutgoingMessage.prototype, '_headers', {
@@ -226,7 +226,7 @@ ObjectDefineProperty(OutgoingMessage.prototype, '_headers', {
226226
headers[StringPrototypeToLowerCase(name)] = [name, val[name]];
227227
}
228228
}
229-
}, 'OutgoingMessage.prototype._headers is deprecated', 'DEP0066')
229+
}, 'OutgoingMessage.prototype._headers is deprecated', 'DEP0066'),
230230
});
231231

232232
ObjectDefineProperty(OutgoingMessage.prototype, 'connection', {
@@ -236,7 +236,7 @@ ObjectDefineProperty(OutgoingMessage.prototype, 'connection', {
236236
},
237237
set: function(val) {
238238
this.socket = val;
239-
}
239+
},
240240
});
241241

242242
ObjectDefineProperty(OutgoingMessage.prototype, '_headerNames', {
@@ -271,7 +271,7 @@ ObjectDefineProperty(OutgoingMessage.prototype, '_headerNames', {
271271
header[0] = val[keys[i]];
272272
}
273273
}
274-
}, 'OutgoingMessage.prototype._headerNames is deprecated', 'DEP0066')
274+
}, 'OutgoingMessage.prototype._headerNames is deprecated', 'DEP0066'),
275275
});
276276

277277

@@ -367,7 +367,7 @@ OutgoingMessage.prototype._send = function _send(data, encoding, callback, byteL
367367
this.outputData.unshift({
368368
data: header,
369369
encoding: 'latin1',
370-
callback: null
370+
callback: null,
371371
});
372372
this.outputSize += header.length;
373373
this._onPendingData(header.length);
@@ -418,7 +418,7 @@ function _storeHeader(firstLine, headers) {
418418
date: false,
419419
expect: false,
420420
trailer: false,
421-
header: firstLine
421+
header: firstLine,
422422
};
423423

424424
if (headers) {
@@ -810,19 +810,19 @@ ObjectDefineProperty(OutgoingMessage.prototype, 'headersSent', {
810810
__proto__: null,
811811
configurable: true,
812812
enumerable: true,
813-
get: function() { return !!this._header; }
813+
get: function() { return !!this._header; },
814814
});
815815

816816
ObjectDefineProperty(OutgoingMessage.prototype, 'writableEnded', {
817817
__proto__: null,
818-
get: function() { return this.finished; }
818+
get: function() { return this.finished; },
819819
});
820820

821821
ObjectDefineProperty(OutgoingMessage.prototype, 'writableNeedDrain', {
822822
__proto__: null,
823823
get: function() {
824824
return !this.destroyed && !this.finished && this[kNeedDrain];
825-
}
825+
},
826826
});
827827

828828
const crlf_buf = Buffer.from('\r\n');
@@ -1175,5 +1175,5 @@ module.exports = {
11751175
parseUniqueHeadersOption,
11761176
validateHeaderName,
11771177
validateHeaderValue,
1178-
OutgoingMessage
1178+
OutgoingMessage,
11791179
};

lib/_http_server.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const { ConnectionsList } = internalBinding('http_parser');
5151
const {
5252
kUniqueHeaders,
5353
parseUniqueHeadersOption,
54-
OutgoingMessage
54+
OutgoingMessage,
5555
} = require('_http_outgoing');
5656
const {
5757
kOutHeaders,
@@ -63,20 +63,20 @@ const {
6363
} = require('internal/http');
6464
const {
6565
defaultTriggerAsyncIdScope,
66-
getOrSetAsyncId
66+
getOrSetAsyncId,
6767
} = require('internal/async_hooks');
6868
const { IncomingMessage } = require('_http_incoming');
6969
const {
7070
connResetException,
71-
codes
71+
codes,
7272
} = require('internal/errors');
7373
const {
7474
ERR_HTTP_REQUEST_TIMEOUT,
7575
ERR_HTTP_HEADERS_SENT,
7676
ERR_HTTP_INVALID_STATUS_CODE,
7777
ERR_HTTP_SOCKET_ENCODING,
7878
ERR_INVALID_ARG_VALUE,
79-
ERR_INVALID_CHAR
79+
ERR_INVALID_CHAR,
8080
} = codes;
8181
const {
8282
kEmptyObject,
@@ -85,7 +85,7 @@ const {
8585
validateInteger,
8686
validateBoolean,
8787
validateLinkHeaderValue,
88-
validateObject
88+
validateObject,
8989
} = require('internal/validators');
9090
const Buffer = require('buffer').Buffer;
9191
const { setInterval, clearInterval } = require('timers');
@@ -169,7 +169,7 @@ const STATUS_CODES = {
169169
508: 'Loop Detected', // RFC 5842 7.2
170170
509: 'Bandwidth Limit Exceeded',
171171
510: 'Not Extended', // RFC 2774 7
172-
511: 'Network Authentication Required' // RFC 6585 6
172+
511: 'Network Authentication Required', // RFC 6585 6
173173
};
174174

175175
const kOnExecute = HTTPParser.kOnExecute | 0;
@@ -663,7 +663,7 @@ function connectionListenerInternal(server, socket) {
663663
// sent to the client.
664664
outgoingData: 0,
665665
requestsCount: 0,
666-
keepAliveTimeoutSet: false
666+
keepAliveTimeoutSet: false,
667667
};
668668
state.onData = socketOnData.bind(undefined,
669669
server, socket, parser, state);
@@ -922,7 +922,7 @@ function resOnFinish(req, res, socket, state, server) {
922922
request: req,
923923
response: res,
924924
socket,
925-
server
925+
server,
926926
});
927927
}
928928

@@ -1014,7 +1014,7 @@ function parserOnIncoming(server, socket, state, req, keepAlive) {
10141014
request: req,
10151015
response: res,
10161016
socket,
1017-
server
1017+
server,
10181018
});
10191019
}
10201020

@@ -1157,5 +1157,5 @@ module.exports = {
11571157
setupConnectionsTracking,
11581158
storeHTTPOptions,
11591159
_connectionListener: connectionListener,
1160-
kServerResponse
1160+
kServerResponse,
11611161
};

0 commit comments

Comments
 (0)