@repo/typescript-config

The @repo/typescript-config package provides shared TypeScript configuration presets for all applications and packages in the monorepo.

Local Development

This package is used as a dev dependency. No build step is required.

Structure

packages/typescript-config/
├── base.json             # Base configuration (shared settings)
├── node.json             # Node.js applications (backend, datapuller)
├── react.json            # React applications (deprecated, use vite.json)
├── vite.json             # Vite + React applications (frontend)
└── package.json

Usage

Extend the appropriate config in your app's tsconfig.json:

{
  "extends": "@repo/typescript-config/vite.json",
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@/*": ["./src/*"]
    }
  },
  "include": ["src"]
}

Available Configs

ConfigUse Case
base.jsonShared settings inherited by all configs
node.jsonBackend services and Node.js packages
vite.jsonVite-based React applications
react.jsonLegacy React config (prefer vite.json)

Base Configuration

The base config includes settings for:

  • Strict Type Checking: Enables strict mode and additional checks
  • Module Resolution: Uses bundler-style resolution
  • Interop: Enables ES module interoperability
  • CSS Modules: Includes plugin for CSS module type support

Included Plugins

PluginPurpose
typescript-plugin-css-modulesProvides type definitions for CSS module imports

This plugin enables autocomplete and type checking for SCSS/CSS module classes:

import styles from "./Component.module.scss";

// TypeScript knows about available class names
<div className={styles.container} />

IDE Integration

For full TypeScript support, ensure your IDE uses the workspace TypeScript version:

  • VSCode: The workspace is configured to use the local TypeScript version automatically