Problem
In backend/src/routes/projectChat.ts (PR #112 / fix/100), the constant declaration is placed between two blocks of import statements:
import { Router } from "express";
import { requireAuth } from "../middleware/auth";
import { createServerSupabase } from "../lib/supabase";
const STREAM_TIMEOUT_MS = 180_000; // ← between imports
import {
buildProjectDocContext,
...
} from "../lib/chatTools";
While TypeScript and the ES module spec both treat import declarations as hoisted (so this compiles and runs correctly), mixing const declarations into the import block is non-idiomatic, confuses linters and code formatters, and can cause subtle issues in CommonJS transpilation.
Fix
Move const STREAM_TIMEOUT_MS = 180_000; to after the last import statement.
Problem
In
backend/src/routes/projectChat.ts(PR #112 / fix/100), the constant declaration is placed between two blocks ofimportstatements:While TypeScript and the ES module spec both treat
importdeclarations as hoisted (so this compiles and runs correctly), mixingconstdeclarations into the import block is non-idiomatic, confuses linters and code formatters, and can cause subtle issues in CommonJS transpilation.Fix
Move
const STREAM_TIMEOUT_MS = 180_000;to after the lastimportstatement.