# TypeScript

URL: https://eoxlabs.dev/stack/typescript
Last updated: 2026-11-26
Publisher: EOXLABS (https://eoxlabs.dev)

Section: [Stack](https://eoxlabs.dev/stack)

TypeScript is JavaScript with a static type system that is checked before the code runs and erased when it ships. EOXLABS writes Workers, SvelteKit apps and internal tooling in strict TypeScript, so one set of types runs from the database schema to the UI, and it validates every untrusted input at runtime because the types are gone by then.

TypeScript is the default language in the [EOXLABS stack](https://eoxlabs.dev/stack). Rust, Go and Swift appear only where a job calls for them.

## Which compiler settings does EOXLABS turn on?

Since [TypeScript 6.0](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-6-0.html), `strict` defaults to `true`, `types` defaults to an empty list and `target` floats to the current ECMAScript year. The [`strict`](https://www.typescriptlang.org/tsconfig/#strict) flag turns on a family of checks: `noImplicitAny`, `strictNullChecks`, `strictFunctionTypes`, `strictBindCallApply`, `strictPropertyInitialization`, `strictBuiltinIteratorReturn`, `noImplicitThis`, `useUnknownInCatchVariables` and `alwaysStrict`. EOXLABS adds settings that `strict` leaves off:

- **[`noUncheckedIndexedAccess`](https://www.typescriptlang.org/tsconfig/noUncheckedIndexedAccess.html)** adds `undefined` to indexed reads, so `rows[0]` must be checked before use.
- **[`exactOptionalPropertyTypes`](https://www.typescriptlang.org/tsconfig/exactOptionalPropertyTypes.html)** separates "missing" from "set to `undefined`", which matters for partial updates.
- **`verbatimModuleSyntax`** and **[`erasableSyntaxOnly`](https://www.typescriptlang.org/tsconfig/erasableSyntaxOnly.html)** keep every file runnable by tools that strip types without transforming them. That rules out `enum`, parameter properties and namespaces with runtime code.
- **An explicit `types` list**, such as the output of `wrangler types` for a Worker, since nothing is included by default any more.

[TypeScript 7.0](https://devblogs.microsoft.com/typescript/announcing-typescript-7-0/), released on July 8, 2026, is a native port of the compiler written in Go. Microsoft reports typical speedups between 8x and 12x on full builds. Options deprecated in 6.0 are hard errors in 7.0, and 7.0 ships without a programmatic API; Microsoft expects a new one in 7.1. Tools that call the compiler's API have nothing in 7.0 to call yet.

## How do types travel from the database to the UI?

The schema is the source. With Drizzle ORM, a table definition produces its row type through [`$inferSelect`](https://orm.drizzle.team/docs/goodies):

```ts
// src/lib/server/schema.ts
import { pgTable, uuid, text } from 'drizzle-orm/pg-core';

export const orders = pgTable('orders', {
  id: uuid('id').primaryKey().defaultRandom(),
  status: text('status', { enum: ['open', 'shipped', 'cancelled'] }).notNull(),
});

export type Order = typeof orders.$inferSelect;
// { id: string; status: 'open' | 'shipped' | 'cancelled' }
```

From there, [`wrangler types`](https://developers.cloudflare.com/workers/languages/typescript/) generates the `Env` interface for the Worker's bindings, and SvelteKit generates [`./$types`](https://svelte.dev/docs/kit/types) for every route, so the value a `load` function returns becomes the type of the page's `data` prop. Rename a column and the type check fails in the component that displays it, not in production. The [SvelteKit](https://eoxlabs.dev/stack/sveltekit) page shows that chain inside a real route.

## Why validate at the boundaries if everything is typed?

Types describe what the code expects, not what arrives. Node.js says it plainly in its documentation for running TypeScript, covered below: "no type checking is performed". Even inside the typed chain, Drizzle's [column types page](https://orm.drizzle.team/docs/column-types/pg) notes that a text `enum` only shapes the inferred type and "won't check runtime values".

EOXLABS therefore parses every value that crosses into the system: request bodies, form fields, webhooks, queue messages, environment variables, third-party API responses and model output in [AI systems](https://eoxlabs.dev/capabilities/ai-systems). Schemas are written with a library that implements [Standard Schema](https://standardschema.dev/schema), a shared interface that Zod (3.24.0+), Valibot (v1.0+) and ArkType (v2.0+) all support, so frameworks and tools accept them interchangeably:

```ts
import * as v from 'valibot';

const CancelOrder = v.object({
  orderId: v.pipe(v.string(), v.uuid()),
  reason: v.pipe(v.string(), v.maxLength(500)),
});

export async function cancelOrder(request: Request): Promise<Response> {
  const result = v.safeParse(CancelOrder, await request.json().catch(() => null));
  if (!result.success) return Response.json({ issues: result.issues }, { status: 400 });
  const { orderId, reason } = result.output; // typed by the schema itself
  // ...
  return new Response(null, { status: 204 });
}
```

The schema is the only place the shape is written; the static type is inferred from it. The same rule runs through AXIOM, EOXLABS's AI data transformation product on the [products](https://eoxlabs.dev/products) page: typed schemas in, typed records out, validation at every stage. [Data pipelines](https://eoxlabs.dev/capabilities/data-pipelines) are built the same way.

## Where does Node type stripping fit?

Node.js runs `.ts` files directly. [Type stripping](https://nodejs.org/api/typescript.html) has been on by default since v23.6.0 and v22.18.0, and is marked stable from v25.2.0 and v24.12.0. It replaces type annotations with whitespace and nothing more:

- it does not type-check, and it ignores `tsconfig.json`, so `paths` aliases don't resolve;
- imports need real file extensions (`./db.ts`), and type-only imports need the `type` keyword;
- it refuses TypeScript files under `node_modules`, so shared internal packages still publish JavaScript.

EOXLABS uses it for migrations, seed scripts and small command-line tools, which removes a build step from code that runs a few times a day. Continuous integration still runs the compiler with `noEmit`, because stripping alone would let a type error reach `main`.

## TypeScript, JavaScript with JSDoc, or Go?

| | Strict TypeScript | JavaScript with JSDoc types | Go |
|---|---|---|---|
| Type checking | Compiler, before deploy | Same checker, reading [JSDoc annotations](https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html) | Compiler, before build |
| On Cloudflare Workers | [First-class](https://developers.cloudflare.com/workers/languages/) | First-class | Only through WebAssembly |
| Types shared with the browser UI | Directly | Directly, with heavier syntax | No; needs a generated client |
| Best fit at EOXLABS | Workers, SvelteKit apps, tooling | Small scripts where a build step isn't wanted | Network daemons a Go team already owns |

## When not to use TypeScript

- **The hot path is CPU-bound.** Parsing, hashing or compression over large inputs belongs in [Rust](https://eoxlabs.dev/stack/rust) compiled to WebAssembly, called from TypeScript.
- **The UI is native Apple software.** SwiftUI apps are written in [Swift](https://eoxlabs.dev/stack/swift); TypeScript stops at the API they call.
- **The service is a long-running daemon owned by a Go team.** Rewriting working Go into TypeScript buys type sharing the service doesn't need.
- **As the only defense against bad input.** If a value comes from outside the process, no compiler setting makes it safe; only a runtime parse does.

## Related

- [SvelteKit](https://eoxlabs.dev/stack/sveltekit): Why EOXLABS builds edge-rendered web products in SvelteKit with Svelte 5 runes, how it splits prerendered and dynamic routes on Workers, and when Next.js or Astro fits better.
- [Rust](https://eoxlabs.dev/stack/rust): Where Rust earns its place in an EOXLABS system, what WebAssembly on Workers allows and limits, the costs in build time and hiring, and how Rust compares with Go and TypeScript.
- [AI Systems and Agents](https://eoxlabs.dev/capabilities/ai-systems): EOXLABS designs AI pipelines and agents in which every output is validated against a schema, traced to its source, reviewed when confidence is low and measured against an evaluation set.
- [Data Pipelines](https://eoxlabs.dev/capabilities/data-pipelines): EOXLABS designs pipelines in which every record can be traced from source to destination: ingestion at the edge, validation with reasons, idempotent transforms, and lineage stored with the data.

## More stack

- [Swift](https://eoxlabs.dev/stack/swift)
- [Tauri](https://eoxlabs.dev/stack/tauri)
