Skip to content

chore: allow relative imports with ts file extension#519

Merged
nicknovitski merged 1 commit intomainfrom
allow-ts-imports
Mar 11, 2026
Merged

chore: allow relative imports with ts file extension#519
nicknovitski merged 1 commit intomainfrom
allow-ts-imports

Conversation

@nicknovitski
Copy link
Member

@nicknovitski nicknovitski commented Mar 9, 2026

Why

ESM requires relative imports to have file endings. New versions of typescript finally allow us to write source files with imports ending in .ts and get built files with imports ending in .js. If you run node --experimental-transform-types on a file, it will treat the import paths as they're written, so typescript source files need to be importing their typescript siblings.

With this enabled, we can run node with strip- or transform-types on the source files, and run tsc to get correctly built output with .js imports.

How

Just added the setting. See other PRs in the stack for changes which depend on this.

Test Plan

No changes to source.

@codecov
Copy link

codecov bot commented Mar 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (575d854) to head (cc136a7).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #519   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          110       110           
  Lines        16711     16711           
  Branches      1519      1519           
=========================================
  Hits         16711     16711           
Flag Coverage Δ
integration 25.55% <ø> (ø)
unittest 94.94% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nicknovitski nicknovitski force-pushed the consistent-type-imports branch from f008ff8 to ae9b691 Compare March 10, 2026 16:47
@nicknovitski nicknovitski changed the base branch from consistent-type-imports to graphite-base/519 March 10, 2026 16:50
@graphite-app graphite-app bot changed the base branch from graphite-base/519 to main March 10, 2026 16:52
Copy link
Member Author

nicknovitski commented Mar 11, 2026

Merge activity

  • Mar 11, 3:10 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Mar 11, 3:11 PM UTC: @nicknovitski merged this pull request with Graphite.

@nicknovitski nicknovitski merged commit f75ed7f into main Mar 11, 2026
7 checks passed
@nicknovitski nicknovitski deleted the allow-ts-imports branch March 11, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants