Skip to content

Commit

Permalink
lib: add trailing commas to more internal files
Browse files Browse the repository at this point in the history
PR-URL: #46811
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • Loading branch information
aduh95 authored and danielleadams committed Apr 11, 2023
1 parent 5f647fb commit 31578ab
Show file tree
Hide file tree
Showing 46 changed files with 185 additions and 190 deletions.
13 changes: 4 additions & 9 deletions lib/.eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,8 @@ globals:
primordials: false
overrides:
- files:
- ./*/promises.js
- ./_stream_*.js
- ./_tls_common.js
- ./assert/*.js
- ./*/*.js
- ./_*.js
- ./child_process.js
- ./cluster.js
- ./console.js
Expand All @@ -276,7 +274,7 @@ overrides:
- ./internal/js_stream_socket.js
- ./internal/mime.js
- ./internal/modules/*.js
- ./internal/per_context/messageport.js
- ./internal/per_context/*.js
- ./internal/perf/*.js
- ./internal/policy/*.js
- ./internal/priority_queue.js
Expand All @@ -285,7 +283,7 @@ overrides:
- ./internal/readme.md
- ./internal/repl.js
- ./internal/repl/*.js
- ./internal/source_map/prepare_stack_trace.js
- ./internal/source_map/*.js
- ./internal/streams/*.js
- ./internal/structured_clone.js
- ./internal/test/*.js
Expand All @@ -298,15 +296,12 @@ overrides:
- ./internal/webidl.js
- ./internal/webstreams/*.js
- ./module.js
- ./path/*.js
- ./process.js
- ./punycode.js
- ./repl.js
- ./stream/*.js
- ./sys.js
- ./test.js
- ./tls.js
- ./url.js
- ./util/*.js
rules:
comma-dangle: [error, always-multiline]
4 changes: 2 additions & 2 deletions lib/_http_agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ Agent.prototype.addRequest = function addRequest(req, options, port/* legacy */,
__proto__: null,
host: options,
port,
localAddress
localAddress,
};
}

Expand Down Expand Up @@ -533,5 +533,5 @@ function asyncResetHandle(socket) {

module.exports = {
Agent,
globalAgent: new Agent()
globalAgent: new Agent(),
};
10 changes: 5 additions & 5 deletions lib/_http_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const {
const {
kUniqueHeaders,
parseUniqueHeadersOption,
OutgoingMessage
OutgoingMessage,
} = require('_http_outgoing');
const Agent = require('_http_agent');
const { Buffer } = require('buffer');
Expand All @@ -78,7 +78,7 @@ const {
ERR_INVALID_ARG_TYPE,
ERR_INVALID_HTTP_TOKEN,
ERR_INVALID_PROTOCOL,
ERR_UNESCAPED_CHARACTERS
ERR_UNESCAPED_CHARACTERS,
} = codes;
const {
validateInteger,
Expand All @@ -87,7 +87,7 @@ const {
const { getTimerDuration } = require('internal/timers');
const {
DTRACE_HTTP_CLIENT_REQUEST,
DTRACE_HTTP_CLIENT_RESPONSE
DTRACE_HTTP_CLIENT_RESPONSE,
} = require('internal/dtrace');

const {
Expand Down Expand Up @@ -650,7 +650,7 @@ function parserOnIncomingClient(res, shouldKeepAlive) {
httpVersionMajor: res.httpVersionMajor,
httpVersionMinor: res.httpVersionMinor,
headers: res.headers,
rawHeaders: res.rawHeaders
rawHeaders: res.rawHeaders,
});

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

module.exports = {
ClientRequest
ClientRequest,
};
2 changes: 1 addition & 1 deletion lib/_http_common.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const incoming = require('_http_incoming');
const {
IncomingMessage,
readStart,
readStop
readStop,
} = incoming;

const kIncomingMessage = Symbol('IncomingMessage');
Expand Down
16 changes: 8 additions & 8 deletions lib/_http_incoming.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const {
StringPrototypeCharCodeAt,
StringPrototypeSlice,
StringPrototypeToLowerCase,
Symbol
Symbol,
} = primordials;

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

if (socket) {
streamOptions = {
highWaterMark: socket.readableHighWaterMark
highWaterMark: socket.readableHighWaterMark,
};
}

Expand Down Expand Up @@ -104,7 +104,7 @@ ObjectDefineProperty(IncomingMessage.prototype, 'connection', {
},
set: function(val) {
this.socket = val;
}
},
});

ObjectDefineProperty(IncomingMessage.prototype, 'headers', {
Expand All @@ -124,7 +124,7 @@ ObjectDefineProperty(IncomingMessage.prototype, 'headers', {
},
set: function(val) {
this[kHeaders] = val;
}
},
});

ObjectDefineProperty(IncomingMessage.prototype, 'headersDistinct', {
Expand All @@ -144,7 +144,7 @@ ObjectDefineProperty(IncomingMessage.prototype, 'headersDistinct', {
},
set: function(val) {
this[kHeadersDistinct] = val;
}
},
});

ObjectDefineProperty(IncomingMessage.prototype, 'trailers', {
Expand All @@ -164,7 +164,7 @@ ObjectDefineProperty(IncomingMessage.prototype, 'trailers', {
},
set: function(val) {
this[kTrailers] = val;
}
},
});

ObjectDefineProperty(IncomingMessage.prototype, 'trailersDistinct', {
Expand All @@ -184,7 +184,7 @@ ObjectDefineProperty(IncomingMessage.prototype, 'trailersDistinct', {
},
set: function(val) {
this[kTrailersDistinct] = val;
}
},
});

IncomingMessage.prototype.setTimeout = function setTimeout(msecs, callback) {
Expand Down Expand Up @@ -452,5 +452,5 @@ function onError(self, error, cb) {
module.exports = {
IncomingMessage,
readStart,
readStop
readStop,
};
34 changes: 17 additions & 17 deletions lib/_http_outgoing.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const {
} = require('_http_common');
const {
defaultTriggerAsyncIdScope,
symbols: { async_id_symbol }
symbols: { async_id_symbol },
} = require('internal/async_hooks');
const {
codes: {
Expand All @@ -70,9 +70,9 @@ const {
ERR_STREAM_ALREADY_FINISHED,
ERR_STREAM_WRITE_AFTER_END,
ERR_STREAM_NULL_VALUES,
ERR_STREAM_DESTROYED
ERR_STREAM_DESTROYED,
},
hideStackFrames
hideStackFrames,
} = require('internal/errors');
const { validateString } = require('internal/validators');
const { isUint8Array } = require('internal/util/types');
Expand Down Expand Up @@ -177,36 +177,36 @@ ObjectDefineProperty(OutgoingMessage.prototype, 'writableFinished', {
this.outputSize === 0 &&
(!this.socket || this.socket.writableLength === 0)
);
}
},
});

ObjectDefineProperty(OutgoingMessage.prototype, 'writableObjectMode', {
__proto__: null,
get() {
return false;
}
},
});

ObjectDefineProperty(OutgoingMessage.prototype, 'writableLength', {
__proto__: null,
get() {
return this.outputSize + (this.socket ? this.socket.writableLength : 0);
}
},
});

ObjectDefineProperty(OutgoingMessage.prototype, 'writableHighWaterMark', {
__proto__: null,
get() {
return this.socket ? this.socket.writableHighWaterMark : HIGH_WATER_MARK;
}
},
});

ObjectDefineProperty(OutgoingMessage.prototype, 'writableCorked', {
__proto__: null,
get() {
const corked = this.socket ? this.socket.writableCorked : 0;
return corked + this[kCorked];
}
},
});

ObjectDefineProperty(OutgoingMessage.prototype, '_headers', {
Expand All @@ -227,7 +227,7 @@ ObjectDefineProperty(OutgoingMessage.prototype, '_headers', {
headers[StringPrototypeToLowerCase(name)] = [name, val[name]];
}
}
}, 'OutgoingMessage.prototype._headers is deprecated', 'DEP0066')
}, 'OutgoingMessage.prototype._headers is deprecated', 'DEP0066'),
});

ObjectDefineProperty(OutgoingMessage.prototype, 'connection', {
Expand All @@ -237,7 +237,7 @@ ObjectDefineProperty(OutgoingMessage.prototype, 'connection', {
},
set: function(val) {
this.socket = val;
}
},
});

ObjectDefineProperty(OutgoingMessage.prototype, '_headerNames', {
Expand Down Expand Up @@ -272,7 +272,7 @@ ObjectDefineProperty(OutgoingMessage.prototype, '_headerNames', {
header[0] = val[keys[i]];
}
}
}, 'OutgoingMessage.prototype._headerNames is deprecated', 'DEP0066')
}, 'OutgoingMessage.prototype._headerNames is deprecated', 'DEP0066'),
});


Expand Down Expand Up @@ -368,7 +368,7 @@ OutgoingMessage.prototype._send = function _send(data, encoding, callback, byteL
this.outputData.unshift({
data: header,
encoding: 'latin1',
callback: null
callback: null,
});
this.outputSize += header.length;
this._onPendingData(header.length);
Expand Down Expand Up @@ -419,7 +419,7 @@ function _storeHeader(firstLine, headers) {
date: false,
expect: false,
trailer: false,
header: firstLine
header: firstLine,
};

if (headers) {
Expand Down Expand Up @@ -806,19 +806,19 @@ ObjectDefineProperty(OutgoingMessage.prototype, 'headersSent', {
__proto__: null,
configurable: true,
enumerable: true,
get: function() { return !!this._header; }
get: function() { return !!this._header; },
});

ObjectDefineProperty(OutgoingMessage.prototype, 'writableEnded', {
__proto__: null,
get: function() { return this.finished; }
get: function() { return this.finished; },
});

ObjectDefineProperty(OutgoingMessage.prototype, 'writableNeedDrain', {
__proto__: null,
get: function() {
return !this.destroyed && !this.finished && this[kNeedDrain];
}
},
});

const crlf_buf = Buffer.from('\r\n');
Expand Down Expand Up @@ -1171,5 +1171,5 @@ module.exports = {
parseUniqueHeadersOption,
validateHeaderName,
validateHeaderValue,
OutgoingMessage
OutgoingMessage,
};
Loading

0 comments on commit 31578ab

Please sign in to comment.