Standard Toolkit
Tooling@accelint/typescript-config

Overview

Shared TypeScript configurations for strict, production-ready type checking across various project types and build targets.

Installation

# Using pnpm (recommended)
pnpm add -D @accelint/typescript-config

# Using npm
npm install --save-dev @accelint/typescript-config

# Using yarn
yarn add -D @accelint/typescript-config

Usage

Extend the appropriate configuration in your tsconfig.json:

{
  "extends": "@accelint/typescript-config/bundler/dom/app",
  "compilerOptions": {
    "outDir": "./dist"
  },
  "include": ["src"]
}

Which Configuration Should I Use?

Choose based on three factors:

1. Build Tool

Do you use tsc for compilation, or a bundler?

  • TSC - Projects using TypeScript Compiler directly

    • Outputs JavaScript files
    • Generates declaration files (.d.ts)
    • Full type checking + compilation
  • Bundler - Projects using Vite, Webpack, esbuild, etc.

    • Type checking only (bundler handles compilation)
    • No JavaScript output from tsc
    • Faster type checking

2. Runtime Environment

Does your code run in the browser or Node.js?

  • DOM - Browser environments (web apps, client-side libraries)

    • Includes DOM type definitions
    • window, document, Web APIs available
  • No-DOM - Node.js environments (servers, CLI tools, backend libraries)

    • No browser APIs
    • Node.js-specific types only

3. Project Type

Is this an application or a publishable package?

  • App - Applications (not published to npm)

    • No declaration file generation
    • Faster builds
  • Library - Standalone packages (published to npm)

    • Generates .d.ts files
    • Strict settings for consumers
  • Library-Monorepo - Packages within a monorepo

    • Composite project support
    • Incremental builds
    • Project references

Configuration Reference

ConfigurationBuild ToolEnvironmentProject Type
tsc/dom/appTSCBrowserApplication
tsc/dom/libraryTSCBrowserLibrary
tsc/dom/library-monorepoTSCBrowserMonorepo Package
tsc/no-dom/appTSCNode.jsApplication
tsc/no-dom/libraryTSCNode.jsLibrary
tsc/no-dom/library-monorepoTSCNode.jsMonorepo Package
bundler/domBundlerBrowserApplication
bundler/dom/appBundlerBrowserApplication
bundler/dom/libraryBundlerBrowserLibrary
bundler/dom/library-monorepoBundlerBrowserMonorepo Package
bundler/no-domBundlerNode.jsApplication
bundler/no-dom/appBundlerNode.jsApplication
bundler/no-dom/libraryBundlerNode.jsLibrary
bundler/no-dom/library-monorepoBundlerNode.jsMonorepo Package

Good to know: bundler/dom and bundler/dom/app are aliases pointing to the same configuration file. Choose whichever path is clearer in your project.

Core Compiler Options

All configurations share these strict, production-ready settings:

{
  "compilerOptions": {
    "strict": true,
    "noUncheckedIndexedAccess": true,
    "noImplicitOverride": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "target": "es2022",
    "allowJs": true,
    "resolveJsonModule": true,
    "moduleDetection": "force",
    "isolatedModules": true,
    "verbatimModuleSyntax": true
  }
}

What These Options Do

OptionPurpose
strict: trueEnables all strict type checking options
noUncheckedIndexedAccess: trueArray/index access returns T | undefined
noImplicitOverride: trueRequires explicit override keyword on subclass methods
esModuleInterop: trueEnables CommonJS/ESM interoperability
skipLibCheck: trueSkips type checking of declaration files (faster builds)
target: "es2022"Outputs ES2022 JavaScript
allowJs: trueAllows JavaScript files in the project
resolveJsonModule: trueAllows importing JSON files
moduleDetection: "force"Forces all files to be treated as modules
isolatedModules: trueEach file can be transpiled independently
verbatimModuleSyntax: truePreserves import/export syntax exactly as written

Examples

Example: React application with Vite

{
  "extends": "@accelint/typescript-config/bundler/dom/app",
  "compilerOptions": {
    "jsx": "react-jsx",
    "paths": {
      "@/*": ["./src/*"]
    }
  },
  "include": ["src"]
}

Example: Node.js CLI tool

{
  "extends": "@accelint/typescript-config/tsc/no-dom/app",
  "compilerOptions": {
    "outDir": "./dist",
    "module": "NodeNext",
    "moduleResolution": "NodeNext"
  },
  "include": ["src"]
}

Example: Publishable React component library

{
  "extends": "@accelint/typescript-config/tsc/dom/library",
  "compilerOptions": {
    "outDir": "./dist",
    "declarationDir": "./dist/types",
    "jsx": "react-jsx"
  },
  "include": ["src"]
}

Example: Next.js application

{
  "extends": "@accelint/typescript-config/bundler/dom/app",
  "compilerOptions": {
    "jsx": "preserve",
    "plugins": [{ "name": "next" }],
    "paths": {
      "@/*": ["./src/*"]
    }
  },
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
  "exclude": ["node_modules"]
}

On this page