chore: Enable "curly" rule to avoid single-statement if confusion/errors.

This commit is contained in:
cpojer
2026-01-31 16:19:20 +09:00
parent 009b16fab8
commit 5ceff756e1
1266 changed files with 27871 additions and 9393 deletions

View File

@@ -39,14 +39,18 @@ export async function requestExecHostViaSocket(params: {
timeoutMs?: number;
}): Promise<ExecHostResponse | null> {
const { socketPath, token, request } = params;
if (!socketPath || !token) return null;
if (!socketPath || !token) {
return null;
}
const timeoutMs = params.timeoutMs ?? 20_000;
return await new Promise((resolve) => {
const client = new net.Socket();
let settled = false;
let buffer = "";
const finish = (value: ExecHostResponse | null) => {
if (settled) return;
if (settled) {
return;
}
settled = true;
try {
client.destroy();
@@ -85,7 +89,9 @@ export async function requestExecHostViaSocket(params: {
const line = buffer.slice(0, idx).trim();
buffer = buffer.slice(idx + 1);
idx = buffer.indexOf("\n");
if (!line) continue;
if (!line) {
continue;
}
try {
const msg = JSON.parse(line) as {
type?: string;