Urgent.News

What's breaking now, across thousands of outlets.

Tech

TypeScript 6.0 `--allowImportingTsExtensions`: What It Unlocks for Monorepo Setups in 2026

TypeScript 6.0 --allowImportingTsExtensions : What It Unlocks for Monorepo Setups in 2026 This article was written with the assistance of AI, under human supervision and review. Most monorepo import failures stem from a single mismatch: TypeScript forbids .ts extensions in source code, but runtime module resolution often requires them. Teams build elaborate path-mapping workarounds, introduce…

TypeScript 6.0 introduces the --allowImportingTsExtensions flag, which resolves a common pain point for monorepo setups. Traditionally, TypeScript forbids .ts file extensions in import statements, but runtime module resolution often requires them. This discrepancy leads to broken imports and requires teams to implement workarounds like path-mapping or build-time rewrites.

With the new flag, TypeScript enables importing .ts files directly without triggering the TS1479 error. The compiler stops enforcing the rule that import specifiers must omit file extensions for non-declaration files. This feature benefits modern bundlers like Vite, esbuild, and Turbopack, which resolve .ts paths natively. When enabled, the flag allows imports such as import { fn } from ./utils.ts without the need for additional configuration.

However, it's important to note that the flag only removes the compile-time prohibition and does not rewrite or emit JavaScript. Modern bundlers handle the actual path resolution. The flag still requires moduleResolution to be set to bundler or nodenext in the tsconfig.json file. Enabling the flag with moduleResolution set to node results in a configuration error.

The primary advantage of this flag is that it eliminates the need for path-rewrite plugins in TypeScript-native build tools. It also surfaces resolution failures earlier in the development loop, providing immediate feedback during type-checking. This shift from silent bundler errors at production build time to immediate feedback during type-checking enhances the development experience.

However, there are some considerations to keep in mind. If the project uses module: esnext or module: nodenext, all import specifiers must be runtime-valid. The flag allows .ts extensions at type-checking but requires runtime compatibility. Additionally, if the project sets module: esnext or module: nodenext, the output generation typically occurs through bundlers, making the noEmit: true setting a natural fit.

In summary, TypeScript 6.0's --allowImportingTsExtensions flag addresses the challenge of cross-package import failures in monorepos by enabling the import of .ts files directly. This feature streamlines monorepo setups, reduces the need for complex workarounds, and improves the development experience by providing earlier resolution failures.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Windows encodes M4A and MP3 at the same bitrate, so the file sizes land 0.6% apart

"Convert M4A to MP3 to save space" is advice you see everywhere. I measured it with the encoders that ship in Windows, and on the same source the two files came out 0.6% apart .

  • Windows encodes M4A and MP3 at the same bitrate of 192kbps.
  • Container overhead causes 0.6% difference in file sizes.
  • Converting between formats loses audio and increases file size.

KT&G expands global duty-free presence with ESSE, RAISON and BOHEM

KT&G, led by CEO Bang Kyung-man, participated in TFWA World 2026, the world’s largest duty-free industry exhibition, held in Cannes, France, from September 27 to October 1 (local time).Organized by…

  • KT&G CEO Bang Kyung-man showcased company's global presence at TFWA World 2026.
  • Company aims to expand operations in Europe and Latin America post-exhibition.

How I Built a Content Agent That Learns with Hindsight

How I Built a Content Agent That Learns with Hindsight Most AI content tools can generate a good recommendation once. The harder problem is getting the next recommendation to change because of what…

  • ContentMind learns from past interactions to improve recommendations
  • Maintains synthetic historical dataset for TechNova brand
  • Uses Hindsight AI memory system for strategic decision-making

More from Tuesday 29 September →