TypeScript
Shared TypeScript configurations with @zeno-lib/typescript
Zeno uses the @zeno-lib/typescript package to share strict TypeScript configurations across all packages and apps.
You never have to manually configure tsconfig.json options like moduleResolution, jsx, lib, strict, Next.js include globs, or the Next.js plugin — just extend one config and everything is set up correctly.
Available Configs
The configs form an inheritance chain — each level extends the previous one:
| Config | Extends | Purpose |
|---|---|---|
base.json | — | Core settings (module resolution, ESNext, bundler mode, JSON imports) |
strict.json | base | Enables strict: true |
strictest.json | strict | Maximum strictness (no unused locals/params, no fallthrough, no unchecked indexed access) |
react.json | strictest | Adds JSX support and DOM lib |
nextjs.json | react | Adds Next.js plugin, next-env.d.ts, and .next/types includes |
Usage
Extend the appropriate config in your package's tsconfig.json:
{
"extends": "@zeno-lib/typescript/nextjs.json"
}That's it. No need to configure compilerOptions, include, or exclude — the config handles module resolution, strict checks, JSX, DOM libs, and Next.js-specific includes for you.
Which Config to Use
| Package type | Config |
|---|---|
| Next.js app | @zeno-lib/typescript/nextjs.json |
| React library | @zeno-lib/typescript/react.json |
| Non-React package | @zeno-lib/typescript/strictest.json |
| Loose / legacy | @zeno-lib/typescript/strict.json |
Examples in the Repo
| Package | Config |
|---|---|
apps/docs | @zeno-lib/typescript/nextjs.json |
packages/ui | @zeno-lib/typescript/react.json |
packages/supabase | @zeno-lib/typescript/strictest.json |
packages/e2e | @zeno-lib/typescript/strictest.json |
What's Included
Base Config
Every config inherits these sensible defaults:
- Bundler module resolution — Works with modern bundlers (Vite, Turbopack, webpack)
- ESNext modules with
verbatimModuleSyntax— Clean import/export handling - JSON imports —
resolveJsonModuleenabled - Incremental builds — Faster recompilation
- Isolated modules — Compatible with SWC and esbuild
- No emit — Bundlers handle output, TypeScript only type-checks
Strictest Config
Enables all strict checks beyond strict: true:
noFallthroughCasesInSwitch— Prevent fallthrough in switch statementsnoImplicitOverride— RequireoverridekeywordnoImplicitReturns— All code paths must returnnoUnusedLocals— No unused local variablesnoUnusedParameters— No unused function parametersnoUncheckedIndexedAccess— Indexed access returnsT | undefinedallowUnreachableCode: false— Error on unreachable codeallowUnusedLabels: false— Error on unused labels
Next.js Config
On top of React support, the Next.js config automatically:
- Registers the
nextTypeScript plugin for App Router type safety - Includes
next-env.d.tsand.next/types/**/*.tsfor generated types - Includes all
*.tsand*.tsxfiles in the project root
Type Checking
Run type checking across all packages:
pnpm types:checkOr for a specific package:
pnpm turbo run types:check --filter @zeno-lib/ui