Skip to content
This repository was archived by the owner on Apr 13, 2026. It is now read-only.

2BAD/tsfix

Repository files navigation

TSFIX

Deprecated: this project is no longer maintained. Use tsdown instead. It handles ESM output, .d.ts generation, path alias resolution, and package validation in a single build step, making post-compilation fixers like tsfix unnecessary. See Migrate to tsdown below.

NPM version License

A post-compilation tool that fixes TypeScript's critical ESM compatibility failures. Properly adds .js extensions, resolves path aliases, and handles index.js imports where tsc consistently falls short, even in the latest versions.

Migrate to tsdown

tsdown (powered by Rolldown + oxc) handles ESM output, .d.ts generation, path alias resolution, and package validation in a single build step, making post-compilation fixers like tsfix unnecessary. It replaces your entire build pipeline with one command.

See the tsdown documentation for setup instructions, or 2BAD/ts-lib-starter for a working example.

Why TSFIX existed

Major TypeScript Issues (Still Unresolved)

  • #16577: Provide a way to add the '.js' file extension to the end of module specifiers (2017)
  • #28288: Feature: disable extensionless imports (2018)
  • #40878: Compiled JavaScript import is missing file extension (2020)
  • #42151: TypeScript cannot emit valid ES modules due to file extension issue (2020)
  • #50501: TypeScript is not an ECMAScript superset post-ES2015 (2022)
  • #61037: rewriteRelativeImportExtensions doesn't rewrite extensions in emitted declaration files (2025)
  • #61213: Allow allowImportingTsExtensions without either '--noEmit' or '--emitDeclarationOnly' (2025)

Previously Addressed (Partially)

  • #49083: "module": "node16" should support extension rewriting (Partially addressed via #59767)

License

MIT

About

One tool to fix all issues that TypeScript's compiler leaves behind

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Generated from 2BAD/ts-lib-starter