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

@uxfront/typescript-config

v0.2.1

Published

Readme

@uxfront/typescript-config

Shared TypeScript configuration for uxfront projects. It type-checks strictly and leaves the output to your bundler, so every project that extends it catches the same mistakes and compiles the same way. For a library that ships its own declaration files, library.json turns emit back on.

Install

pnpm add -D typescript @uxfront/typescript-config

Usage

Create a tsconfig.json that extends the shared config and lists your own files:

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

Keep the include: TypeScript resolves an extended config's include from the folder that config lives in, so without your own it looks for files inside node_modules/@uxfront/typescript-config and stops with TS18003: No inputs were found. Override any option under compilerOptions in the same file.

What it sets

Let's start with strictness, which is where you'll notice the config most:

| Option | Value | What it does for you | | -------------------------- | ------ | --------------------------------------------------------------------------------------- | | strict | true | Turns on every strict check, like strictNullChecks and noImplicitAny | | noUncheckedIndexedAccess | true | Types items[0] and record[key] as possibly undefined, so you check before you use | | noImplicitOverride | true | Asks for override on a method that replaces one from its base class |

Modules are written the way a bundler reads them:

| Option | Value | What it does for you | | ---------------------- | ------------ | --------------------------------------------------------------------------------------- | | module | "preserve" | Keeps import and export as you wrote them, and resolves imports the way bundlers do | | verbatimModuleSyntax | true | Asks for import type on an import that only brings in types | | isolatedModules | true | Flags code that a tool compiling one file at a time can't compile | | moduleDetection | "force" | Treats every file as a module, even one without import or export | | esModuleInterop | true | Lets you default-import a CommonJS package | | resolveJsonModule | true | Lets you import a .json file, typed from its contents | | allowJs | true | Includes .js files in the project |

And the target and output:

| Option | Value | What it does for you | | -------------- | ----------------------------------- | -------------------------------------------------------------------- | | target | "es2022" | Leaves ES2022 syntax, like class fields and top-level await, as is | | lib | ["es2022", "dom", "dom.iterable"] | Types the ES2022 built-ins and the browser DOM | | noEmit | true | Type-checks only and writes no files | | skipLibCheck | true | Skips type-checking the .d.ts files of your dependencies |

Two of these are worth a second look:

  • verbatimModuleSyntax fails the type-check on import { Foo } from "./types" when Foo is only a type, with TS1484. Write import type { Foo } from "./types" instead. @uxfront/oxlint-config has the matching typescript/consistent-type-imports rule, so your editor flags it as you type.
  • noEmit means tsc never writes files. A bundler like Vite or a library builder like tsdown compiles your code, and tsc only checks it.

For a library that ships its own declaration files, extend the library variant instead, which turns emit back on.

Library variant

Let's look at library.json, for a package that ships declaration files, like one that tsc builds or one that a bundler builds and tsc describes. It extends tsconfig.json, so you keep every check above, and sets four compiler options:

| Option | Value | What it does for you | | ------------- | --------------------- | ------------------------------------------------------------------------------------------ | | noEmit | false | Lets tsc write files again | | declaration | true | Writes a .d.ts file for each source file | | composite | true | Lets other projects point at this one through references, and rebuilds only what changed | | outDir | "${configDir}/dist" | Writes the output to your own project's dist folder |

Extend it the same way, with your own include:

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

Running tsc -p . then writes dist/src/index.js, dist/src/index.d.ts and dist/tsconfig.tsbuildinfo. The variant sets no rootDir, so your include can also cover files beside src, like vite.config.ts, and the output keeps the src folder. For dist/index.js, add "rootDir": "src" under compilerOptions, and add tsconfig.tsbuildinfo to your .gitignore, since TypeScript then writes it beside your tsconfig.json. To leave the JavaScript to your bundler, add "emitDeclarationOnly": true.

A few things are worth knowing before your first build:

  • outDir is your project's dist. ${configDir} stands for the folder of your own tsconfig.json. A plain "dist" would resolve next to library.json, inside node_modules. ${configDir} needs TypeScript 5.5 or later.
  • composite needs every file in your include. It writes a .tsbuildinfo file, so the next build only redoes what changed. A file that's imported but not in include stops the build with TS6307.
  • It excludes your node_modules and dist. That way a second build doesn't read the first one's output as input, which stops it with TS5055: Cannot write file … because it would overwrite input file. Your own exclude replaces this one, so if you set one, keep "${configDir}/dist" in it.