Working with TypeScript?

TypeScript migration stuck or strict mode broken? We sort it out.

Most TypeScript projects that reach us were started by someone who understood the compiler and finished by people who did not. Half the files have real types, half have any, and nobody is sure which flags in tsconfig were deliberate. We bring order back without rewriting everything.

  • Since 2015Fixing technology
  • FreeEstimates
  • US teamReal engineers

tsc.log

still failing

What it is

TypeScript at a glance

TypeScript is a typed superset of JavaScript from Microsoft, first released in 2012 and shaped by Anders Hejlsberg, the same designer who worked on Turbo Pascal and C#. Anything that is valid JavaScript is also valid TypeScript, and the compiler turns the typed source back into plain JavaScript that runs in browsers and on Node.

The type system is structural rather than nominal, which fits the shape-based way JavaScript objects are actually used. It was built to be adopted gradually, one file at a time, so an existing codebase can move over at whatever pace the team can manage. Major versions have shipped roughly every year since 1.0 arrived in 2014.

Adoption is now very broad. React, Vue, Angular, Next.js, Nest, Deno and the SDKs of most major platforms publish their own type definitions, and Microsoft itself uses TypeScript inside the Office codebase. The current line is TypeScript 5.x, which introduced const type parameters, the new decorators proposal and much sharper inference.

Type
Typed superset of JavaScript
First released
2012
License
Apache 2.0
Maintained by
Microsoft Corporation
Typically used for
Large JavaScript codebases, web apps, Node back ends, SDKs, libraries

The honest version

TypeScript pros and cons

No technology is all upside. This is where TypeScript earns its place and where it tends to cause trouble.

Where TypeScript is strong

  • It catches real bugs before you shipA whole class of mistakes, wrong argument order, missing field, null where an object was expected, surface at compile time instead of at three in the morning in production.
  • The editor becomes much smarterAutocomplete, go-to-definition and safe rename all work properly once the types are in place, which quietly speeds every day of coding across the team.
  • Types for almost every packageDefinitelyTyped covers most of npm through the @types scope, so third-party libraries are usable with full checking even when they were written in plain JavaScript.
  • A structural type system that fits JSTypes describe the shape of a value rather than demanding a named class, which matches how JavaScript objects already flow through a program and keeps annotations light.
  • Powerful generics and unionsGenerics, conditional types and discriminated unions let you model state machines and API payloads precisely, so invalid combinations stop compiling rather than appearing at runtime.
  • The language keeps improvingRecent versions added const type parameters, the new decorators proposal and much smarter inference, so code gets safer without needing more hand-written annotations.

Where TypeScript bites

  • tsconfig.json is a minefieldDozens of flags interact in ways that are not obvious, and many teams turn on strict mode without turning on the half-strict flags that catch the most common bugs.
  • Third-party types can lieThe @types packages often lag behind the libraries they describe, or disagree with the current runtime, so the compiler gives a green light while the code still throws.
  • Incremental migration needs careFlipping on allowJs, checkJs and noImplicitAny in the wrong order leaves a project where nobody is sure which files are being checked at all, which is worse than plain JavaScript.
  • Another step in the build chainSomething, tsc, ts-node, tsx, swc or esbuild, has to compile the code before Node will run it, and that something occasionally disagrees with the others about what the source means.
  • Type gymnastics are a trapAdvanced generics can express almost anything, which tempts people to express things that would be clearer as a plain function with a comment above it.
  • The types can be wrongTypeScript only checks that the annotations are internally consistent. If a type claims a field exists when the JSON from the server does not actually include it, the compiler cheerfully believes you.

Sound familiar?

Common TypeScript problems we fix

The TypeScript problems that bring people to us, and what you have once each one is fixed.

allowJs: true · checkJs: false

The JavaScript to TypeScript migration stalled

Half the files were renamed to .ts, the rest were left alone, and the team has quietly stopped adding types because nobody agrees on the plan.

A migration finished in order

tsc --strict: 420 new errors

Strict mode was turned on and the build broke

Someone enabled strict in tsconfig, the error count exploded, and the fix was to wrap half the codebase in any and ts-ignore.

Strict mode on, cleanly

cannot find module '@/components/Foo'

Path aliases work in the editor but not at runtime

The paths in tsconfig were set up for VS Code, but the Node runtime, Jest and the bundler each need their own matching configuration.

One source of truth for paths

TS2322 in generated code

The build breaks between major TS versions

Upgrading TypeScript from 4.x to 5.x surfaces real type errors that the older compiler accepted, usually around generics and library typings.

Upgraded with the backlog cleared

@types/react disagrees with react

DefinitelyTyped versions have drifted

The @types/* packages are out of step with the libraries they describe, and dependabot updates each of them on its own schedule.

Type and runtime versions aligned

repo: last touched 14 months ago

A TypeScript project was dropped in your lap

The previous developer left, the README is two years old, and running the build locally produces errors nobody has seen before.

A project you can actually run

runtime error · types say it's safe

The types did not catch the bug you expected

A value from an API or a JSON file was typed by hand, the runtime data no longer matches, and the compiler sees nothing wrong.

Checks at the real boundary

unknown file extension .ts

ts-node cannot run the entrypoint

ESM, CommonJS, ts-node, tsx and the installed TypeScript version all have opinions, and they rarely all agree the first time.

One command that just runs it

What we do

TypeScript help, from rescue to upkeep

Call us for one tsconfig, or hand us the whole repository.

Rescue
A build that will not pass, a migration that stopped halfway, or a project nobody can run locally any more.
Strict mode rollout
Turning on strict and the half-strict flags file by file, with a clear plan and no rush of any annotations.
JavaScript migration
Moving an existing JS codebase to TypeScript in stages, keeping the application shippable the whole way through.
Type system design
Discriminated unions, generics and runtime validators placed where they earn their keep and left out where they would just add noise.
Version upgrades
Moving across major TypeScript releases, resolving the newly surfaced errors, and keeping the toolchain in step.
Managed Tech
Reviews, upgrades and a team to call when the compiler says something nobody on the team can explain.

How it works

From first message to fixed

  1. Look Free estimate

    Tell us what's going wrong. We look at it, then tell you plainly what's wrong and what it will cost.

  2. Fix

    We fix the cause, not the symptom. If something is down, getting it back up comes first.

  3. Harden

    Backups, monitoring, updates and access, so the same problem can't quietly come back.

  4. Hand back or stay on

    You get a plain-language write-up. Or we stay on for hosting, upkeep and new work.

Often found together

Running TypeScript alongside something else?

We work on the whole stack, so the problem can be wherever it actually is.

Questions

TypeScript questions

Something else? Call+1 737 727 7327

Can you migrate our JavaScript codebase to TypeScript?

Yes, and in almost every case it is done in stages rather than in one weekend. We turn on allowJs, convert the files that change most often first, add real types at the module boundaries, and only tighten the compiler flags once the quieter corners have been reached.

Can you turn on strict mode in our existing TypeScript project?

Yes. The right order is usually the individual flags, noImplicitAny, strictNullChecks and the rest, one at a time, rather than flipping strict in one commit. That keeps the error count manageable and avoids a wave of any annotations that would undo the benefit.

Why does our TypeScript build break between major versions?

Each major release sharpens inference and tightens the bundled library types, so code the previous compiler let through may now be rejected. The errors are usually real. We fix them properly rather than suppressing them with ts-ignore.

Can you take over a TypeScript project from a previous developer?

Yes. We get the project building and running on a fresh machine first, document what was actually set up, then propose a short list of changes that would make it easier for the next person to touch.

Why do our TypeScript types not catch the bug we expected?

The compiler only checks that your annotations agree with each other. If data comes in from an API, a database or a JSON file and the type is a hand-written guess, the runtime value can drift away from the type without the compiler ever noticing. The fix is a validator at that boundary.

How much does TypeScript help cost?

Estimates are free. Hand us the tsconfig and the file that will not compile, and we quote a scope before any change is pushed.

Free estimate

TypeScript giving you trouble?

Tell us what you're running and what's going wrong. A person reads it and comes back with an estimate.

  • No charge to find out what it will take
  • If it's urgent, say so

Replies come from a person. By sending, you authorize us to email you back. No marketing.