Skip to content

Commit a1ccba3

Browse files
authored
chore: use prettier v3 everywhere (#5169)
1 parent e347a3c commit a1ccba3

Some content is hidden

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

68 files changed

+513
-508
lines changed

package-lock.json

Lines changed: 7 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"name": "socket.io",
23
"private": true,
34
"workspaces": [
45
"packages/socket.io-component-emitter",
@@ -52,7 +53,7 @@
5253
"mocha": "^10.6.0",
5354
"node-forge": "^1.3.1",
5455
"nyc": "^17.0.0",
55-
"prettier": "^2.8.8",
56+
"prettier": "^3.3.2",
5657
"redis": "^4.6.15",
5758
"rimraf": "^6.0.0",
5859
"rollup": "^2.79.1",

packages/engine.io-client/lib/globals.node.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export function parse(setCookieString: string): Cookie {
5555
case "Max-Age":
5656
const expiration = new Date();
5757
expiration.setUTCSeconds(
58-
expiration.getUTCSeconds() + parseInt(value, 10)
58+
expiration.getUTCSeconds() + parseInt(value, 10),
5959
);
6060
cookie.expires = expiration;
6161
break;

packages/engine.io-client/lib/socket.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,8 @@ export class SocketWithoutUpgrade extends Emitter<
381381
(typeof location !== "undefined" && location.port
382382
? location.port
383383
: this.secure
384-
? "443"
385-
: "80");
384+
? "443"
385+
: "80");
386386

387387
this.transports = [];
388388
this._transportsByName = {};
@@ -408,7 +408,7 @@ export class SocketWithoutUpgrade extends Emitter<
408408
transportOptions: {},
409409
closeOnBeforeunload: false,
410410
},
411-
opts
411+
opts,
412412
);
413413

414414
this.opts.path =
@@ -434,7 +434,7 @@ export class SocketWithoutUpgrade extends Emitter<
434434
addEventListener(
435435
"beforeunload",
436436
this._beforeunloadEventListener,
437-
false
437+
false,
438438
);
439439
}
440440
if (this.hostname !== "localhost") {
@@ -484,7 +484,7 @@ export class SocketWithoutUpgrade extends Emitter<
484484
secure: this.secure,
485485
port: this.port,
486486
},
487-
this.opts.transportOptions[name]
487+
this.opts.transportOptions[name],
488488
);
489489

490490
debug("options: %j", opts);
@@ -749,7 +749,7 @@ export class SocketWithoutUpgrade extends Emitter<
749749
type: PacketType,
750750
data?: RawData,
751751
options?: WriteOptions,
752-
fn?: () => void
752+
fn?: () => void,
753753
) {
754754
if ("function" === typeof data) {
755755
fn = data;
@@ -874,7 +874,7 @@ export class SocketWithoutUpgrade extends Emitter<
874874
removeEventListener(
875875
"beforeunload",
876876
this._beforeunloadEventListener,
877-
false
877+
false,
878878
);
879879
removeEventListener("offline", this._offlineEventListener, false);
880880
}

packages/engine.io-client/lib/transport.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class TransportError extends Error {
1414
constructor(
1515
reason: string,
1616
readonly description: any,
17-
readonly context: any
17+
readonly context: any,
1818
) {
1919
super(reason);
2020
}
@@ -79,7 +79,7 @@ export abstract class Transport extends Emitter<
7979
protected onError(reason: string, description: any, context?: any) {
8080
super.emitReserved(
8181
"error",
82-
new TransportError(reason, description, context)
82+
new TransportError(reason, description, context),
8383
);
8484
return this;
8585
}

packages/engine.io-client/lib/transports/polling-xhr.node.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ export class XHR extends BaseXHR {
1515
Object.assign(
1616
opts,
1717
{ xd: this.xd, cookieJar: this.socket?._cookieJar },
18-
this.opts
18+
this.opts,
1919
);
2020
return new Request(
2121
(opts) => new XMLHttpRequest(opts),
2222
this.uri(),
23-
opts as RequestOptions
23+
opts as RequestOptions,
2424
);
2525
}
2626
}

packages/engine.io-client/lib/transports/polling-xhr.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export class Request extends Emitter<
122122
constructor(
123123
private readonly createRequest: (opts: RequestOptions) => XMLHttpRequest,
124124
uri: string,
125-
opts: RequestOptions
125+
opts: RequestOptions,
126126
) {
127127
super();
128128
installTimerFunctions(this, opts);
@@ -151,7 +151,7 @@ export class Request extends Emitter<
151151
"ca",
152152
"ciphers",
153153
"rejectUnauthorized",
154-
"autoUnref"
154+
"autoUnref",
155155
);
156156
opts.xdomain = !!this._opts.xd;
157157

@@ -197,7 +197,7 @@ export class Request extends Emitter<
197197
if (xhr.readyState === 3) {
198198
this._opts.cookieJar?.parseCookies(
199199
// @ts-ignore
200-
xhr.getResponseHeader("set-cookie")
200+
xhr.getResponseHeader("set-cookie"),
201201
);
202202
}
203203

@@ -354,7 +354,7 @@ function newRequest(opts) {
354354
if (!xdomain) {
355355
try {
356356
return new globalThis[["Active"].concat("Object").join("X")](
357-
"Microsoft.XMLHTTP"
357+
"Microsoft.XMLHTTP",
358358
);
359359
} catch (e) {}
360360
}

packages/engine.io-client/lib/transports/websocket.node.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class WS extends BaseWS {
1414
createSocket(
1515
uri: string,
1616
protocols: string | string[] | undefined,
17-
opts: Record<string, any>
17+
opts: Record<string, any>,
1818
) {
1919
if (this.socket?._cookieJar) {
2020
opts.headers = opts.headers || {};

packages/engine.io-client/lib/transports/websocket.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export abstract class BaseWS extends Transport {
4343
"origin",
4444
"maxPayload",
4545
"family",
46-
"checkServerIdentity"
46+
"checkServerIdentity",
4747
);
4848

4949
if (this.opts.extraHeaders) {
@@ -64,7 +64,7 @@ export abstract class BaseWS extends Transport {
6464
abstract createSocket(
6565
uri: string,
6666
protocols: string | string[] | undefined,
67-
opts: Record<string, any>
67+
opts: Record<string, any>,
6868
);
6969

7070
/**
@@ -166,7 +166,7 @@ export class WS extends BaseWS {
166166
createSocket(
167167
uri: string,
168168
protocols: string | string[] | undefined,
169-
opts: Record<string, any>
169+
opts: Record<string, any>,
170170
) {
171171
return !isReactNative
172172
? protocols

packages/engine.io-client/lib/transports/webtransport.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export class WT extends Transport {
3030
// @ts-ignore
3131
this._transport = new WebTransport(
3232
this.createUri("https"),
33-
this.opts.transportOptions[this.name]
33+
this.opts.transportOptions[this.name],
3434
);
3535
} catch (err) {
3636
return this.emitReserved("error", err);
@@ -51,7 +51,7 @@ export class WT extends Transport {
5151
this._transport.createBidirectionalStream().then((stream) => {
5252
const decoderStream = createPacketDecoderStream(
5353
Number.MAX_SAFE_INTEGER,
54-
this.socket.binaryType
54+
this.socket.binaryType,
5555
);
5656
const reader = stream.readable.pipeThrough(decoderStream).getReader();
5757

0 commit comments

Comments
 (0)