fix(serve): use const cwd in POST /session (prefer-const lint)

CI lint failed with packages/cli/src/serve/server.ts:199:9 prefer-const: 'cwd' is never reassigned. The wave-4 rewrite split the original 'let cwd; if (!cwd) cwd = boundWorkspace' into a single ternary, which removes the only mutation path; the variable should be const accordingly.
This commit is contained in:
Shaojin Wen 2026-05-14 07:50:33 +08:00
parent c922a4e862
commit 1c7f5f069a

View file

@ -196,7 +196,7 @@ export function createServeApp(
.json({ error: '`cwd` must be a string absolute path when provided' });
return;
}
let cwd = hasCwd ? (body['cwd'] as string) : boundWorkspace;
const cwd = hasCwd ? (body['cwd'] as string) : boundWorkspace;
if (!path.isAbsolute(cwd)) {
res
.status(400)