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

@codefast/typescript-config

v0.10.0

Published

Shared TypeScript configuration for the monorepo

Readme

@codefast/typescript-config

Shared TypeScript configuration presets for projects that want one strict, bundler-first baseline and small, focused variants for libraries, React, and Next.js.

npm version license

Overview

@codefast/typescript-config gives you one strict, bundler-first TypeScript baseline and a few focused variants — for libraries, React, and Next.js. Extend the preset that fits your project, then override anything you need locally.

The presets are plain JSON tsconfig files. There's no runtime code, and nothing to import.

  • Strict by default. strict, noUncheckedIndexedAccess, noImplicitOverride, and verbatimModuleSyntax come from the base that every preset extends.
  • Bundler-first. An ESNext module with moduleResolution: "bundler", so exports and imports maps resolve the way Vite, esbuild, and friends resolve them.
  • lib and target match the runtime floors: both are ES2025, the newest edition that Node 24 and the browser floor both ship (support policy). A builtin newer than that, such as Map.prototype.getOrInsert, is a type error here rather than a runtime crash on the floor. Move them together only when a floor moves.
  • Ambient types follow the runtime. No preset loads @types/node or lists ESNext.Disposable. A program that runs on Node adds types: ["node"], which brings the Node globals and explicit resource management with it. A browser program leaves both out: Safari has not shipped explicit resource management yet.
  • Type-check only. The presets set noEmit; a separate build overlay turns on emit and .d.ts generation.
  • Plain JSON. No runtime code, nothing to import.

Installation

pnpm add -D @codefast/typescript-config

@codefast/typescript-config requires Node.js 24 or later, and typescript 7 or later as a peer dependency — TypeScript 7 is the one compiler the presets are checked against. The package is published on 0.x and versioned on its own track: breaking changes ship as minor versions, so pin the minor version when you need stability.

Quick start

Extend the preset that matches your project in tsconfig.json. Keep the .json extension — the package exports the full file names only.

{
  "extends": "@codefast/typescript-config/base.json",
  "include": ["src"]
}

Options you set locally always win, so adjusting a preset takes one line — here, a package that runs on Node:

{
  "extends": "@codefast/typescript-config/library.json",
  "compilerOptions": {
    "types": ["node"]
  }
}

Presets

| Preset | Extends | Purpose | | -------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | base.json | — | Strict, bundler-first baseline: ES2025 target, ESNext module, DOM + ES2025 libs, type-check only. | | library.json | base.json | Headless packages: lib is ES2025 only, so relying on a browser global is a type error. A package that runs on Node adds types: ["node"]. | | react.json | base.json | React with the automatic JSX runtime (jsx: "react-jsx") — components need no React import. | | next.json | base.json | Next.js apps: jsx: "preserve", incremental builds, and the next TypeScript plugin. | | library-build.json | (overlay) | Build-emit overrides for a build config: noEmit: false, declaration + isolatedDeclarations, declaration and source maps, and types: [], so test-only ambient types stay out of the build. |

Choosing a preset

A publishable package with no browser coupling, which runs wherever JavaScript runs:

{
  "extends": "@codefast/typescript-config/library.json",
  "include": ["src"]
}

A package or CLI that runs on Node:

{
  "extends": "@codefast/typescript-config/library.json",
  "compilerOptions": {
    "types": ["node"]
  },
  "include": ["src"]
}

A React app or component library:

{
  "extends": "@codefast/typescript-config/react.json",
  "include": ["src"]
}

A Next.js app:

{
  "extends": "@codefast/typescript-config/next.json",
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"]
}

Next.js 16.3 and later type-check with TypeScript 7 through its tsc CLI (experimental.useTypeScriptCli, on by default). Earlier Next.js releases need TypeScript 6's compiler API, so an app on one of them stays on 0.9.x of this package.

Building with tsc

library-build.json is an overlay, not a standalone preset. It carries only the emit options, so layer it over your development config in a separate tsconfig.build.json. List both in extends to keep the strictness from library.json and add .d.ts emit on top:

{
  "extends": ["./tsconfig.json", "@codefast/typescript-config/library-build.json"],
  "compilerOptions": {
    "rootDir": "./src",
    "outDir": "./dist"
  },
  "include": ["src/**/*.ts"],
  "exclude": ["src/**/*.test.ts"]
}

Then tsc -p tsconfig.build.json emits .js, .d.ts, and their maps into dist/. isolatedDeclarations requires an explicit type annotation on every export, which is what lets declarations be produced file by file.

The overlay sets types: [], so the test types your development config loads (vitest/globals, for example) stay out of the build. A package that runs on Node sets types: ["node"] again in its tsconfig.build.json. A browser or universal package leaves it empty, so a Node global in its source fails the build.

Notable compiler options

Every preset inherits its strictness from base.json:

  • strict — the full strict family (strictNullChecks, noImplicitAny, and friends).
  • noUncheckedIndexedAccess — indexed access is typed T | undefined, forcing explicit handling.
  • noImplicitOverride — a method that overrides a base-class member must say override.
  • verbatimModuleSyntax — type-only imports must be written import type, so a transpiler can drop them without type information.
  • isolatedModules + moduleDetection: "force" — every file is a module and must transpile in isolation, as bundlers require.
  • module: "ESNext" + moduleResolution: "bundler" — modern ESM with bundler-style exports/imports resolution.
  • noEmit — presets type-check only; emitting is your bundler's job, or library-build.json's when tsc builds for you.
  • forceConsistentCasingInFileNames — catches import-path casing mismatches before they break case-sensitive CI.
  • skipLibCheck, esModuleInterop, resolveJsonModule — pragmatic defaults for consuming third-party packages and JSON.

Documentation

Contributing

The package is developed in the codefast monorepo; the repo-wide contributing guide covers setup, the test taxonomy, and the release flow.

License

Released under the MIT License.