Skip to content

Decide whether relative imports should name their file extension #1972

Open

Description

@dawsontoth

Question

Should Studio's relative imports name their file extension, for example import { x } from './foo.ts'?

A cross-model review of #1969 kept suggesting it, and the adjudicator recorded it as a known gap. Today the repo does the opposite on purpose:

  • src has 1,444 relative imports, none with an extension.
  • No tsconfig sets allowImportingTsExtensions, so a .ts specifier fails tsc (TS5097).

What adopting it would take

  • Turn on allowImportingTsExtensions (which needs noEmit or emitDeclarationOnly; Vite already does the emitting).
  • Rewrite every relative import, by codemod.
  • Add a lint rule so the two styles don't mix.

What it buys is closer alignment with Node's ESM resolution, which matters only for code run by Node without a bundler. The notes in CLAUDE.local.md about replaying modules under node --experimental-strip-types hit exactly that. Nothing in Studio's shipped build needs it.

Low priority. Close as won't-do if extensionless imports stay the house style.

Review-Deferral: 3784139b4d036a24 severity=nit category=maintainability

Raised by the cross-model review of #1969.

🤖 Generated by Anthropic Claude Code (Claude Opus 5.5); posted via @dawsontoth.

Activity

  1. added theissue type on Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Priority

    P3

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions