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.3.9

Published

Shared TypeScript configuration for the monorepo

Readme

TypeScript Config

Shared TypeScript configuration presets for the CodeFast monorepo, providing standardized TypeScript settings for different project types including React applications, Next.js projects, libraries, and base configurations.

NPM Version

Installation

Install the package via pnpm (recommended):

pnpm add -D @codefast/typescript-config

Or using npm:

npm install --save-dev @codefast/typescript-config

Requirements:

  • Node.js version 20.0.0 or higher
  • TypeScript version 5.0.0 or higher

Quick Start

Create a tsconfig.json file in your project and extend from the appropriate configuration:

{
  "extends": "@codefast/typescript-config/base.json"
}

Usage

Base Configuration

Basic configuration for all TypeScript projects:

{
  "extends": "@codefast/typescript-config/base.json",
  "compilerOptions": {
    "outDir": "./dist"
  },
  "include": ["src/**/*"],
  "exclude": ["node_modules", "dist"]
}

Library Configuration

For developing libraries and packages:

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

React Configuration

For React components and applications:

{
  "extends": "@codefast/typescript-config/react.json",
  "compilerOptions": {
    "outDir": "./dist"
  },
  "include": ["src/**/*"],
  "exclude": ["node_modules", "dist"]
}

Next.js Configuration

For Next.js applications:

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

Configurations

Available Configurations

| Configuration | Description | Use Case | |---------------|-------------|----------| | base.json | Basic configuration with strict settings | Base for all projects | | library.json | Extends base, adds library-specific options | NPM packages, shared libraries | | react.json | Extends base, adds React JSX support | React components and apps | | next.json | Extends base, optimized for Next.js | Next.js applications |

Base Configuration Features

  • Strict Type Checking: Enables all strict options
  • Modern JavaScript: Targets ESNext with full ESNext lib support
  • Module Resolution: Node-style resolution with ESNext modules
  • Developer Experience: Force consistent casing, no unused variables/parameters
  • JSON Support: Resolve JSON modules
  • Isolated Modules: Transpile each file separately

Library Configuration Features

  • Declaration Generation: Automatically generates .d.ts files
  • Source Maps: Generate source maps for debugging
  • Strip Internal: Remove internal declarations from output
  • ESNext Only: Does not include DOM libs

React Configuration Features

  • Modern JSX Transform: Uses react-jsx transform
  • React Import Source: Automatically import React when needed
  • DOM Support: Full DOM and DOM.Iterable libs

Next.js Configuration Features

  • JavaScript Support: Allow .js files
  • Incremental Compilation: Faster subsequent builds
  • JSX Preserve: Let Next.js handle JSX transform
  • Bundler Resolution: Optimized for bundler
  • No Emit: Next.js handles compilation
  • Next.js Plugin: TypeScript plugin support

API Reference

Configuration Files

base.json

Base configuration with essential compiler options:

interface BaseConfig {
  compilerOptions: {
    allowSyntheticDefaultImports: true;
    declaration: true;
    esModuleInterop: true;
    forceConsistentCasingInFileNames: true;
    isolatedModules: true;
    lib: ["DOM", "DOM.Iterable", "ESNext"];
    module: "ESNext";
    moduleDetection: "force";
    moduleResolution: "node";
    noEmitOnError: true;
    noFallthroughCasesInSwitch: true;
    noImplicitOverride: true;
    noImplicitReturns: true;
    noUnusedLocals: true;
    noUnusedParameters: true;
    resolveJsonModule: true;
    skipLibCheck: true;
    strict: true;
    target: "ESNext";
    useDefineForClassFields: true;
  };
}

library.json

Library-specific configuration extending base:

interface LibraryConfig extends BaseConfig {
  compilerOptions: BaseConfig["compilerOptions"] & {
    declaration: true;
    lib: ["ESNext"];
    sourceMap: true;
    stripInternal: true;
  };
}

react.json

React-specific configuration:

interface ReactConfig extends BaseConfig {
  compilerOptions: BaseConfig["compilerOptions"] & {
    jsx: "react-jsx";
    jsxImportSource: "react";
  };
}

next.json

Next.js-specific configuration:

interface NextConfig extends BaseConfig {
  compilerOptions: BaseConfig["compilerOptions"] & {
    allowJs: true;
    incremental: true;
    jsx: "preserve";
    moduleResolution: "bundler";
    noEmit: true;
    plugins: [{ name: "next" }];
  };
}

Contributing

We welcome all contributions! To start developing:

Environment Setup

  1. Fork this repository.
  2. Clone to your machine: git clone <your-fork-url>
  3. Install dependencies: pnpm install
  4. Create a new branch: git checkout -b feature/feature-name

Development Workflow

# Build all packages
pnpm build:packages

# Development mode for typescript-config
pnpm dev --filter=@codefast/typescript-config

# Run tests
pnpm test --filter=@codefast/typescript-config

# Lint and format
pnpm lint:fix
pnpm format
  1. Commit and submit pull request.

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Compatibility

This package is compatible with:

  • TypeScript: 5.0.0+
  • Node.js: 20.0.0+
  • React: 18.0.0+ (when using react.json)
  • Next.js: 14.0.0+ (when using next.json)