or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

index.md
tile.json

tessl/npm-tsconfig--bases

Centralized recommendations for TSConfig bases - pre-configured TypeScript configurations for various runtime environments

Workspace
tessl
Visibility
Public
Created
Last updated
Describes

pkg:github/tsconfig/bases

To install, run

npx @tessl/cli install tessl/npm-tsconfig--bases@1.0.0

index.mddocs/

TSConfig Bases

TSConfig Bases provides centralized recommendations for TypeScript compiler configurations, hosting pre-configured TSConfig files for various runtime environments. It's the "Definitely Typed for TSConfigs" - a community-owned collection of base configurations that you can extend in your TypeScript projects.

Package Information

  • Package Name: tsconfig/bases (GitHub repository)
  • Package Type: npm (multiple scoped packages)
  • Language: TypeScript/JSON
  • Installation: Individual packages like npm install --save-dev @tsconfig/node18

Core Imports

TSConfig bases are extended in your tsconfig.json rather than imported:

{
  "extends": "@tsconfig/recommended/tsconfig.json"
}

Multiple configurations can be extended since TypeScript 5.0:

{
  "extends": ["@tsconfig/strictest/tsconfig", "@tsconfig/node18/tsconfig"]
}

Basic Usage

{
  "extends": "@tsconfig/node18/tsconfig.json",
  "compilerOptions": {
    "outDir": "./dist",
    "rootDir": "./src"
  },
  "include": ["src/**/*"],
  "exclude": ["node_modules", "dist"]
}

Architecture

TSConfig Bases uses a template-based generation system:

  • Base Configurations: JSON files in /bases directory defining compiler options
  • Template System: Generates individual npm packages from base configurations
  • Automated Publishing: GitHub Actions deploy changed bases automatically
  • Community Driven: Owned and improved by the TypeScript community

Capabilities

Available Base Configurations

The ecosystem provides 25+ pre-configured TypeScript configurations for different runtime environments.

interface BaseConfiguration {
  $schema: string;
  display: string;
  _version?: string;
  compilerOptions: CompilerOptions;
}

interface CompilerOptions {
  target?: string;
  module?: string;
  lib?: string[];
  strict?: boolean;
  esModuleInterop?: boolean;
  skipLibCheck?: boolean;
  moduleResolution?: string;
  [key: string]: any;
}

Popular Base Configurations:

  • @tsconfig/recommended - General TypeScript recommendations
  • @tsconfig/node18 - Node.js 18 environment
  • @tsconfig/react-native - React Native development
  • @tsconfig/next - Next.js applications
  • @tsconfig/strictest - Maximum type safety
  • @tsconfig/create-react-app - Create React App projects

Node.js Environments

Specialized configurations for different Node.js versions with appropriate targets and module systems.

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "display": "Node 18",
  "_version": "18.2.0",
  "compilerOptions": {
    "lib": ["es2023"],
    "module": "node16",
    "target": "es2022",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "moduleResolution": "node16"
  }
}

Available Node Configurations:

  • @tsconfig/node-lts - Latest LTS version
  • @tsconfig/node10 through @tsconfig/node21 - Specific versions
  • Each optimized for the target Node.js runtime capabilities

Framework-Specific Configurations

Pre-configured setups for popular frameworks and tools.

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "display": "Create React App",
  "_version": "2.0.0",
  "compilerOptions": {
    "lib": ["dom", "dom.iterable", "esnext"],
    "module": "esnext",
    "moduleResolution": "bundler",
    "target": "es2015",
    "allowJs": true,
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": true,
    "isolatedModules": true,
    "jsx": "react-jsx",
    "noEmit": true,
    "noFallthroughCasesInSwitch": true,
    "resolveJsonModule": true,
    "skipLibCheck": true,
    "strict": true
  }
}

Framework Configurations:

  • @tsconfig/create-react-app - Create React App setup
  • @tsconfig/next - Next.js applications
  • @tsconfig/nuxt - Nuxt.js applications
  • @tsconfig/react-native - React Native development
  • @tsconfig/svelte - Svelte applications
  • @tsconfig/remix - Remix applications

Runtime-Specific Configurations

Configurations optimized for specific JavaScript runtimes and environments.

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "display": "Deno",
  "compilerOptions": {
    "jsx": "react",
    "lib": [],
    "resolveJsonModule": true,
    "strict": true
  }
}

Runtime Configurations:

  • @tsconfig/deno - Deno runtime
  • @tsconfig/bun - Bun runtime
  • @tsconfig/cypress - Cypress testing
  • @tsconfig/docusaurus - Docusaurus documentation

Configuration Extension System

All base configurations support TypeScript's extends mechanism for customization.

interface ExtendedConfiguration {
  extends: string | string[];
  compilerOptions?: Partial<CompilerOptions>;
  include?: string[];
  exclude?: string[];
  files?: string[];
}

Extension Examples:

{
  "extends": "@tsconfig/node18/tsconfig.json",
  "compilerOptions": {
    "outDir": "./build",
    "sourceMap": true,
    "declaration": true
  }
}

Multiple Extension (TypeScript 5.0+):

{
  "extends": ["@tsconfig/strictest/tsconfig", "@tsconfig/node18/tsconfig"]
}

Package Generation System

The repository uses automated scripts to generate individual npm packages from base configurations.

interface PackageGeneration {
  createNpmPackages(): void;
  deployChangedPackages(): void;
  generateRecommended(): void;
  updateMarkdownReadme(): void;
}

interface BaseFile {
  name: string;
  display: string;
  _version?: string;
  compilerOptions: CompilerOptions;
}

Generation Process:

  1. Base JSON files define configurations
  2. Template system creates package structure
  3. Package.json generated with appropriate metadata
  4. README.md created with usage instructions
  5. Automated deployment via GitHub Actions

Installation and Usage Patterns

Each base configuration is published as a separate npm package following consistent patterns.

# Install specific base
npm install --save-dev @tsconfig/node18
yarn add --dev @tsconfig/node18

# Install multiple bases
npm install --save-dev @tsconfig/strictest @tsconfig/node18
{
  "extends": "@tsconfig/node18/tsconfig.json",
  "compilerOptions": {
    "outDir": "./dist",
    "rootDir": "./src"
  },
  "include": ["src/**/*"],
  "exclude": ["node_modules", "dist"]
}

Complete Base Configuration List

The ecosystem provides the following pre-configured bases:

Base NamePackageTarget Environment
Recommended@tsconfig/recommendedGeneral TypeScript best practices
Strictest@tsconfig/strictestMaximum type safety
Bun@tsconfig/bunBun runtime
Create React App@tsconfig/create-react-appCreate React App projects
Cypress@tsconfig/cypressCypress testing framework
Deno@tsconfig/denoDeno runtime
Docusaurus@tsconfig/docusaurusDocusaurus documentation
Ember@tsconfig/emberEmber.js applications
Next.js@tsconfig/nextNext.js applications
Node LTS@tsconfig/node-ltsLatest Node.js LTS
Node 10-21@tsconfig/node10 - @tsconfig/node21Specific Node.js versions
Nuxt@tsconfig/nuxtNuxt.js applications
React Native@tsconfig/react-nativeReact Native development
Remix@tsconfig/remixRemix applications
Svelte@tsconfig/svelteSvelte applications
Taro@tsconfig/taroTaro framework
Vite React@tsconfig/vite-reactVite + React setup

Types

interface TSConfigBase {
  $schema: "https://json.schemastore.org/tsconfig";
  display: string;
  _version?: string;
  compilerOptions: {
    target?: "es3" | "es5" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "esnext";
    module?: "none" | "commonjs" | "amd" | "system" | "umd" | "es6" | "es2015" | "es2020" | "es2022" | "esnext" | "node16" | "nodenext";
    lib?: string[];
    moduleResolution?: "node" | "classic" | "node16" | "nodenext" | "bundler";
    strict?: boolean;
    esModuleInterop?: boolean;
    skipLibCheck?: boolean;
    forceConsistentCasingInFileNames?: boolean;
    allowSyntheticDefaultImports?: boolean;
    jsx?: "preserve" | "react" | "react-jsx" | "react-jsxdev" | "react-native";
    [key: string]: any;
  };
}

interface PackageTemplate {
  name: string;
  repository: {
    type: "git";
    url: string;
    directory: string;
  };
  license: "MIT";
  description?: string;
  keywords?: string[];
  version?: string;
}