YeetCode

TypeScript Configs

Shared TypeScript configuration presets in the @yeetcode/typescript package.

The @yeetcode/typescript package (tooling/typescript/) provides shared TypeScript configuration presets that all workspaces extend. This ensures consistent compiler settings across the entire monorepo.

Available Presets

Base (base.json)

The foundation config used by all other presets:

{
  "compilerOptions": {
    "esModuleInterop": true,
    "isolatedModules": true,
    "lib": ["es2022", "DOM", "DOM.Iterable"],
    "module": "NodeNext",
    "moduleDetection": "force",
    "moduleResolution": "NodeNext",
    "noUncheckedIndexedAccess": true,
    "resolveJsonModule": true,
    "skipLibCheck": true,
    "strict": true,
    "target": "ES2022"
  }
}

Key decisions:

  • Strict mode is always on — no exceptions
  • noUncheckedIndexedAccess forces you to handle undefined when accessing array/object indices
  • ES2022 target for modern JavaScript features

Next.js (nextjs.json)

Extends base with Next.js-specific settings:

{
  "extends": "./base.json",
  "compilerOptions": {
    "plugins": [{ "name": "next" }],
    "module": "ESNext",
    "moduleResolution": "Bundler",
    "allowJs": true,
    "jsx": "preserve",
    "noEmit": true
  }
}

Uses Bundler module resolution and the Next.js TypeScript plugin for route type safety.

React Library (react-library.json)

For shared React packages (like @yeetcode/email):

{
  "extends": "./base.json",
  "compilerOptions": {
    "jsx": "react-jsx"
  }
}

Usage

Each workspace extends the appropriate preset in its tsconfig.json:

{
  "extends": "@yeetcode/typescript/nextjs",
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@/*": ["./*"]
    }
  }
}

Convex Backend

The Convex backend uses its own tsconfig.json (not extending shared presets) because Convex has specific requirements:

{
  "compilerOptions": {
    "lib": ["ESNext"],
    "target": "ESNext",
    "module": "Preserve",
    "moduleResolution": "bundler",
    "jsx": "react-jsx",
    "strict": true,
    "noUncheckedIndexedAccess": true,
    "verbatimModuleSyntax": true
  }
}

This still follows the same philosophy — strict mode, noUncheckedIndexedAccess, and modern ESNext targeting.

On this page