chore: migrate to oxlint and oxfmt

Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
This commit is contained in:
Peter Steinberger
2026-01-14 14:31:43 +00:00
parent 912ebffc63
commit c379191f80
1480 changed files with 28608 additions and 43547 deletions

View File

@@ -15,9 +15,7 @@ describe("ports helpers", () => {
const server = net.createServer();
await new Promise((resolve) => server.listen(0, resolve));
const port = (server.address() as net.AddressInfo).port;
await expect(ensurePortAvailable(port)).rejects.toBeInstanceOf(
PortInUseError,
);
await expect(ensurePortAvailable(port)).rejects.toBeInstanceOf(PortInUseError);
server.close();
});
@@ -27,22 +25,14 @@ describe("ports helpers", () => {
log: vi.fn(),
exit: vi.fn() as unknown as (code: number) => never,
};
await handlePortError(
{ code: "EADDRINUSE" },
1234,
"context",
runtime,
).catch(() => {});
await handlePortError({ code: "EADDRINUSE" }, 1234, "context", runtime).catch(() => {});
expect(runtime.error).toHaveBeenCalled();
expect(runtime.exit).toHaveBeenCalledWith(1);
});
it("classifies ssh and gateway listeners", () => {
expect(
classifyPortListener(
{ commandLine: "ssh -N -L 18789:127.0.0.1:18789 user@host" },
18789,
),
classifyPortListener({ commandLine: "ssh -N -L 18789:127.0.0.1:18789 user@host" }, 18789),
).toBe("ssh");
expect(
classifyPortListener(
@@ -59,10 +49,7 @@ describe("ports helpers", () => {
port: 18789,
status: "busy" as const,
listeners: [{ pid: 123, commandLine: "ssh -N -L 18789:127.0.0.1:18789" }],
hints: buildPortHints(
[{ pid: 123, commandLine: "ssh -N -L 18789:127.0.0.1:18789" }],
18789,
),
hints: buildPortHints([{ pid: 123, commandLine: "ssh -N -L 18789:127.0.0.1:18789" }], 18789),
};
const lines = formatPortDiagnostics(diagnostics);
expect(lines[0]).toContain("Port 18789 is already in use");