Skip to content

Commit

Permalink
Merge pull request #419 from peers/renovate/major-typescript-eslint-m…
Browse files Browse the repository at this point in the history
…onorepo

chore(deps): update typescript-eslint monorepo to v6 (major)
  • Loading branch information
jonasgloning authored Aug 8, 2023
2 parents 18b374a + afefc76 commit 6c19e88
Show file tree
Hide file tree
Showing 13 changed files with 212 additions and 340 deletions.
9 changes: 5 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:@typescript-eslint/strict-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked"
],
"ignorePatterns": ["coverage", "jest.config.js", "dist", "__test__"],
"env": {
"node": true,
"es6": true
},
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
"project": true
}
}
2 changes: 1 addition & 1 deletion __test__/models/messageQueue.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { describe, expect, it } from "@jest/globals";

import { MessageQueue } from "../../src/models/messageQueue.ts";
import { MessageType } from "../../src/enums.ts";
import type { IMessage } from "../../src/models/message.ts";
import type { IMessage } from "../../src/index.js";
import { wait } from "../utils.ts";

describe("MessageQueue", () => {
Expand Down
2 changes: 1 addition & 1 deletion __test__/services/messagesExpire/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { describe, expect, it } from "@jest/globals";

import { Client } from "../../../src/models/client.ts";
import { Realm } from "../../../src/models/realm.ts";
import type { IMessage } from "../../../src/models/message.ts";
import type { IMessage } from "../../../src/index.js";
import { MessagesExpire } from "../../../src/services/messagesExpire/index.ts";
import { MessageHandler } from "../../../src/messageHandler/index.ts";
import { MessageType } from "../../../src/enums.ts";
Expand Down
4 changes: 2 additions & 2 deletions __test__/services/webSocketServer/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,11 @@ describe("WebSocketServer", () => {
ws.destroy = async (): Promise<void> => {
ws.close();

wait(10);
await wait(10);

webSocketServer.destroy?.();

wait(10);
await wait(10);

ws.destroy = undefined;
};
Expand Down
12 changes: 7 additions & 5 deletions bin/peerjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import fs from "node:fs";
const optimistUsageLength = 98;
import yargs from "yargs";
import { hideBin } from "yargs/helpers";
import { PeerServer } from "../src";
import { PeerServer } from "../src/index.ts";
import type { AddressInfo } from "node:net";
import type { CorsOptions } from "cors";

Expand Down Expand Up @@ -66,7 +66,7 @@ const opts = y
type: "string",
demandOption: false,
describe: "custom path",
default: process.env["PEERSERVER_PATH"] || "/",
default: process.env["PEERSERVER_PATH"] ?? "/",
},
allow_discovery: {
type: "boolean",
Expand All @@ -89,18 +89,20 @@ const opts = y
.parseSync();

if (!opts.port) {
opts.port = parseInt(process.env["PORT"] as string);
// .port is only not set if the PORT env var is set
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
opts.port = parseInt(process.env["PORT"]!);
}
if (opts.cors) {
opts["corsOptions"] = {
origin: opts.cors,
} satisfies CorsOptions;
}
process.on("uncaughtException", function (e) {
console.error("Error: " + e);
console.error("Error: " + e.toString());
});

if (opts.sslkey || opts.sslcert) {
if (opts.sslkey ?? opts.sslcert) {
if (opts.sslkey && opts.sslcert) {
opts["ssl"] = {
key: fs.readFileSync(path.resolve(opts.sslkey)),
Expand Down
Loading

0 comments on commit 6c19e88

Please sign in to comment.