npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dvashim/typescript-config

v2.0.5

Published

Shared TypeScript configurations

Readme

TypeScript Configurations

CI npm version npm downloads License: MIT TypeScript Checked with Biome

Requires TypeScript >= 6.

Installation

npm:

npm install -D @dvashim/typescript-config

or pnpm:

pnpm add -D @dvashim/typescript-config

Configurations

| Name | Path | Alias | | ---- | ---- | ----- | | Base | @dvashim/typescript-config or @dvashim/typescript-config/base | — | | Library development | @dvashim/typescript-config/lib/dev or @dvashim/typescript-config/lib-dev | @dvashim/typescript-config/lib | | Library production | @dvashim/typescript-config/lib/prod or @dvashim/typescript-config/lib-prod | — | | React JSX application | @dvashim/typescript-config/app/react or @dvashim/typescript-config/app-react | @dvashim/typescript-config/app | | Vite + React JSX application | @dvashim/typescript-config/app/react/vite or @dvashim/typescript-config/app-react-vite | — | | Node | @dvashim/typescript-config/node | — |

Use

Base configuration:

// tsconfig.json (base)

// Strict ES2024 + ESM foundation with bundler resolution.
// Enforces verbatim module syntax, erasable-only syntax,
// and maximum type safety (strict, exactOptionalPropertyTypes,
// noUncheckedIndexedAccess, noUnusedLocals, etc.).

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "extends": "@dvashim/typescript-config",
  "include": ["src"]
}

Library development configuration:

// tsconfig.json (library development)

// Extends base for library development.
// Enables .d.ts declarations, composite builds,
// source maps, declaration maps, and isolated declarations.

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "extends": "@dvashim/typescript-config/lib-dev",
  "include": ["src"]
}

Library production configuration:

// tsconfig.json (library production)

// Extends lib-dev for production builds.
// Strips source maps, declaration maps, comments,
// and @internal declarations for minimal output.

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "extends": "@dvashim/typescript-config/lib-prod",
  "include": ["src"]
}

React JSX application configuration:

// tsconfig.json (react jsx application)

// Extends base for React applications.
// Adds DOM + DOM.Iterable + DOM.AsyncIterable libs,
// automatic JSX runtime, esnext modules, and
// .ts/.tsx extension imports.
// No emit — bundler handles output.

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "extends": "@dvashim/typescript-config/app-react",
  "include": ["src"]
}

Vite + React JSX application configuration:

// tsconfig.json (vite + react jsx application)

// Extends React config with Vite client types
// (import.meta.env, import.meta.hot, asset imports).

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "extends": "@dvashim/typescript-config/app-react-vite",
  "include": ["src"]
}

Node configuration:

// tsconfig.json (node)

// Extends base for Node.js tooling files
// (build configs, scripts). @types/node,
// esnext modules, and .ts extension imports.
// No emit — bundler handles output.

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "extends": "@dvashim/typescript-config/node",
  "include": ["vite.config.ts"]
}

Rules

Base configuration

Options listed below are set explicitly. Additional options (strict, moduleResolution: "bundler", noUncheckedSideEffectImports, forceConsistentCasingInFileNames, useDefineForClassFields, esModuleInterop) rely on TypeScript 6 defaults.

  • Type Checking

  • Modules

    • module: es2022 — Specifies the module code generation format.
    • moduleDetection: force — Forces all files to be treated as ES modules.
    • resolveJsonModule: true — Allows importing .json files as typed modules.
    • types: [] — Disables auto-inclusion of @types/* packages; extending configs provide their own.
  • Emit

    • noEmitOnError: true — Prevents emitting output files when type errors are present.
  • Interop Constraints

    • verbatimModuleSyntax: true — Preserves import and export syntax exactly as written.
    • isolatedModules: true — Ensures each file can be safely transpiled in isolation.
    • erasableSyntaxOnly: true — Restricts usage to syntax that can be fully erased during compilation (no enums, namespaces, or parameter properties).
  • Language and Environment

    • target: es2024 — Sets the JavaScript language version for emitted output.
    • lib: ["ES2024"] — Specifies built-in library declaration files included in compilation.
  • Completeness

    • skipLibCheck: true — Skips type checking of declaration files for faster builds.

Library development configuration

Extends the base configuration with emit settings for .d.ts generation and incremental builds.

  • Emit

    • declaration: true — Emits .d.ts type declaration files alongside JavaScript output.
    • declarationMap: true — Generates source maps for .d.ts files, enabling "Go to Definition" to navigate to the original source.
    • sourceMap: true — Generates .js.map source map files for debugging.
  • Modules

    • types: [] — Explicitly blocks ambient @types/* auto-discovery.
  • Interop Constraints

    • isolatedDeclarations: true — Requires explicit type annotations on exports so declaration files can be generated by tools other than tsc.
  • Projects

    • composite: true — Enables project references and incremental compilation.

Library production configuration

Extends the library development configuration and strips debug artifacts for smaller, cleaner output.

  • Emit

    • sourceMap: false — Disables .js.map source map generation.
    • declarationMap: false — Disables .d.ts.map source map generation.
    • removeComments: true — Strips comments from emitted JavaScript.
    • stripInternal: true — Removes declarations marked with @internal JSDoc tags from .d.ts output.

React JSX application configuration

Extends the base configuration for React applications with DOM types and no-emit mode.

  • Modules

    • module: esnext — Uses the latest module features for bundler consumption.
    • allowImportingTsExtensions: true — Allows importing TypeScript files with explicit .ts/.tsx extensions.
    • types: [] — Explicitly blocks ambient @types/* auto-discovery.
  • Emit

    • noEmit: true — Disables emitting compiled JavaScript files (bundler handles output).
  • Language and Environment

    • jsx: react-jsx — Uses the automatic React JSX runtime (react/jsx-runtime), no manual import React needed.
    • lib: ["ES2024", "DOM", "DOM.Iterable", "DOM.AsyncIterable"] — Includes ES2024 APIs, DOM APIs, iterable DOM collections, and async iterable DOM APIs (e.g., ReadableStream async iteration).

Vite + React JSX application configuration

Extends the React JSX application configuration with Vite-specific type declarations.

  • Modules

    • types: ["vite/client"] — Includes Vite client types (import.meta.env, import.meta.hot, asset imports). Restricts auto-included global types to only vite/client.

Node configuration

Extends the base configuration for Node.js tooling files (Vite configs, build scripts, etc.) processed by bundlers.

  • Modules

    • module: esnext — Uses the latest module features for bundler consumption.
    • allowImportingTsExtensions: true — Allows importing TypeScript files with explicit .ts extensions.
    • types: ["node"] — Includes type declarations for Node.js globals and built-in modules.
  • Emit

    • noEmit: true — Disables emitting compiled JavaScript files (bundler handles output).