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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@lokalise/tsconfig

v3.0.0

Published

Shared TypeScript configuration for Lokalise projects.

Readme

@lokalise/tsconfig

Shared TypeScript configuration for Lokalise projects.

Getting Started

Requirements:

  • TypeScript >=5.9.0
  • ESM codebase

Installation:

npm install --save-dev @lokalise/tsconfig

TypeScript configuration depends on whether you're using a bundler (Vite, esbuild, SWC, etc.) or tsc to build your code:

  • Bundlers are commonly used for frontend applications, where they also bundle and optimize code for faster loading.
  • tsc is typically used for backend applications and libraries, where you directly compile TypeScript into JavaScript.

Using a Bundler

Create a tsconfig.json that whitelists the files for type-checking:

{
  "extends": "@lokalise/tsconfig/bundler",
  "include": ["src/**/*", "test/**/*", "vitest.config.ts"]
}

For frontend applications running in the DOM:

{
  "extends": "@lokalise/tsconfig/bundler-dom",
  "include": ["src/**/*", "test/**/*", "vitest.config.ts"]
}

Using tsc (TypeScript Compiler)

Create a tsconfig.json that whitelists the files for type-checking:

{
  "extends": "@lokalise/tsconfig/tsc",
  "include": ["src/**/*", "test/**/*", "vitest.config.ts"]
}

For frontend applications running in the DOM:

{
  "extends": "@lokalise/tsconfig/tsc-dom",
  "include": ["src/**/*", "test/**/*", "vitest.config.ts"]
}

Create a tsconfig.build.json for building the code, ensuring that only the necessary files are included, and unnecessary ones are excluded.

For building an application or a service:

{
  "extends": ["./tsconfig.json", "@lokalise/tsconfig/build-app"],
  "include": ["src/**/*"],
  "exclude": ["src/**/*.test.ts"]
}

For building a publishable library:

{
  "extends": ["./tsconfig.json", "@lokalise/tsconfig/build-public-lib"],
  "include": ["src/**/*"],
  "exclude": ["src/**/*.test.ts"]
}

For building a private monorepo library:

{
  "extends": ["./tsconfig.json", "@lokalise/tsconfig/build-private-lib"],
  "include": ["src/**/*"],
  "exclude": ["src/**/*.test.ts"]
}

Additional Configuration Options

JSX Support

If your app uses JSX, add jsx option in tsconfig.json:

{
  "extends": "@lokalise/tsconfig/bundler-dom",
  "compilerOptions": {
    "jsx": "react-jsx"
  }
}

Adding Global Types

To include additional type definitions, add types option in tsconfig.json:

{
  "extends": "@lokalise/tsconfig/tsc",
  "compilerOptions": {
    "types": ["vitest/globals"]
  }
}

Options That Can Be Disabled To Ease Adoption

erasableSyntaxOnly

It marks the following syntax as errors:

  • enum declarations
  • namespace and module with runtime code
  • Parameter properties in classes
  • Non-ECMAScript import = and export = assignments

To disable:

{
  "extends": "@lokalise/tsconfig/tsc",
  "compilerOptions": {
    "erasableSyntaxOnly": false
  }
}

noUncheckedIndexedAccess

It ensures that accessing arrays or objects without checking if a value exists results in a TypeScript error, preventing potential runtime crashes.

Example for accessing the array:

const arr: string[] = [];

console.log(arr[0].trim());
  • With "noUncheckedIndexedAccess": true → TypeScript error: "Object is possibly undefined"
  • With "noUncheckedIndexedAccess": false → No error, but at runtime, this will throw: "TypeError: Cannot read properties of undefined (reading 'trim')"

Example for accessing the object:

const obj: Record<string, string> = {};

console.log(obj.some.trim());
  • With "noUncheckedIndexedAccess": true → TypeScript error: "obj.some is possibly undefined"
  • With "noUncheckedIndexedAccess": false → No error, but at runtime, this will throw: "TypeError: Cannot read properties of undefined (reading 'trim')"

To disable:

{
  "extends": "@lokalise/tsconfig/tsc",
  "compilerOptions": {
    "noUncheckedIndexedAccess": false
  }
}