Skip to content

projectChat.ts: STREAM_TIMEOUT_MS const is placed between import statements #119

@bmersereau

Description

@bmersereau

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions