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

magic-tsconfig

v1.2.4

Published

Shared TypeScript config bases (base, internal-package, nextjs, expo).

Downloads

1,286

Readme

How it works

  1. base.json carries the strict settings every project shares. The other three extend it and override only what their target needs (see Bases).
  2. A project extends exactly one file and overrides locally. Relative paths in an extended config resolve against the file that declares them, so the bases ship no paths and no cache state.
// tsconfig.json
{ "extends": "magic-tsconfig/base.json" }

Install

pnpm add -D magic-tsconfig

Bases

| File | Use for | | ----------------------- | ------------------------------------------------------------------------- | | base.json | plain TypeScript, apps, anything without a framework preset | | internal-package.json | workspace/publishable libraries that emit .d.ts (emitDeclarationOnly) | | nextjs.json | Next.js apps (jsx: preserve, DOM libs, the next TS plugin) | | expo.json | Expo / React Native apps (jsx: react-jsx, excludes ios/android) |

Use

// tsconfig.json (publishable library)
{
  "extends": "magic-tsconfig/internal-package.json",
  "include": ["src"],
  "compilerOptions": { "outDir": "dist", "rootDir": "src" },
}
// tsconfig.json (Next.js)
{
  "extends": "magic-tsconfig/nextjs.json",
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
  "compilerOptions": { "paths": { "@/*": ["./src/*"] } },
}
// tsconfig.json (Expo). Expo's own base must come first so ours wins on conflicts.
{
  "extends": ["expo/tsconfig.base", "magic-tsconfig/expo.json"],
  "include": ["**/*.ts", "**/*.tsx", ".expo/types/**/*.ts", "expo-env.d.ts"],
}

Notes

  • checkJs is on. If a project has untyped .js it can't fix yet, set "checkJs": false locally rather than dropping the base.
  • noUncheckedIndexedAccess is on. It's the single most annoying and most valuable option here; don't turn it off, add the guard.
  • module: Preserve plus moduleResolution: Bundler hands module resolution to the bundler (Metro, Turbopack, tsdown). For a package published to npm that consumers resolve with Node, override module/moduleResolution in the package's own tsconfig.

incremental

base.json, internal-package.json and expo.json do not set it. A base that publishable packages extend has no business carrying build-cache state: with incremental on and no tsBuildInfoFile, tsc writes <config>.tsbuildinfo next to the config, outside outDir, and a rm -rf dist && tsc then emits nothing at all: exit 0, no output, no error.

nextjs.json does set it, and has to. next build writes any of its suggested compiler options that are missing from the resolved config directly into your tsconfig.json, and reformats the whole file while it is there. incremental is the only suggested option this package would otherwise leave unset, so without it every next build leaves a dirty tree and the next oxfmt --check fails on a file nobody edited. It is safe there because nextjs.json is noEmit (there is no output for a stale build info to suppress) and because Next keeps its own build info in .next/cache.

  • Keep *.tsbuildinfo in .gitignore. Your own tsc --noEmit writes tsconfig.tsbuildinfo beside your tsconfig.
  • tsBuildInfoFile cannot be shipped here to move it: relative paths in an extended config resolve against the file that declares them, so an entry in this package would write inside node_modules/magic-tsconfig. Set it locally if you want it somewhere specific.

If you opt incremental on anywhere else, scope the cache in the same tsconfig: "tsBuildInfoFile": "dist/.tsbuildinfo". Pair them everywhere: a tsBuildInfoFile left behind without incremental throws error TS5069, a hard typecheck failure, on some type checkers (tsgo accepts it, TypeScript doesn't).