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

Stop committing .env files, node_modules and it.only: check your staged changes before you press Commit

You stage everything with one click, type "fix login redirect", commit, push. The next morning the pull request has 4,812 changed files. Or six, and one of them is .env .

  • Committing .env files can cause pull request nightmares with leaked secrets
  • it.only() in tests can lead to untested code and green CI
  • Pre-commit hooks and Git ignore are insufficient; use CommitSieve extension

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.

Building the OpsSentry AI Frontend with Next.js, TypeScript and Hindsight

AI-powered incident management needs more than an intelligent backend. The interface also needs to make complex information easy to understand and act on.

  • OpsSentry AI frontend built with Next.js, TypeScript, and Hindsight
  • AI incident assistant integrated via application's API for interactions
  • Hindsight memory explorer in frontend for context from past interactions

More from Tuesday 29 September →