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

typescript-glob-override-plugin

v0.1.2

Published

TypeScript Language Service plugin: enable specific compiler options for files matching glob patterns

Readme

typescript-glob-override-plugin

TypeScript Language Service plugin that enables specific compiler options for files matching glob patterns — without changing the project-wide tsconfig.json.

Useful for incrementally introducing strict checks into a large codebase.

Install

npm install --save-dev typescript-glob-override-plugin
# or
yarn add -D typescript-glob-override-plugin

Setup

Add the plugin to your tsconfig.json:

{
  "compilerOptions": {
    "plugins": [
      {
        "name": "typescript-glob-override-plugin",
        "files": [
          "a/**/*.ts",
          "b/**/*.ts"
        ],
        "compilerOptions": {
          "noImplicitOverride": true,
          "strictNullChecks": true,
          "strictFunctionTypes": true,
          "noImplicitAny": true
        }
      }
    ]
  }
}

VS Code

Make sure VS Code uses the workspace TypeScript version (not the built-in one):

  1. Open the Command Palette (Cmd+Shift+P)
  2. Run TypeScript: Select TypeScript Version
  3. Choose Use Workspace Version

Or add to .vscode/settings.json:

{
  "typescript.tsdk": "node_modules/typescript/lib",
  "typescript.preferences.allowLocalPluginLoads": true
}

Configuration

| Field | Type | Required | Description | |-------|------|----------|-------------| | files | string[] | Yes | Glob patterns relative to the tsconfig.json directory. Files matching any pattern will have compilerOptions applied. | | compilerOptions | object | Yes | Any valid TypeScript compiler options to overlay on matched files. Common values: noImplicitOverride, strictNullChecks, strictFunctionTypes, noImplicitAny, strict. |

Glob syntax

| Pattern | Matches | |---------|---------| | src/foo/**/*.ts | All .ts files anywhere under src/foo/ | | src/**/*.ts | All .ts files anywhere under src/ | | src/foo/*.ts | .ts files directly inside src/foo/ (not nested) | | src/foo/bar.ts | Exactly src/foo/bar.ts |

CLI: tsc-override

The package ships a tsc-override command that enforces the glob-based rules at build time / in CI — as a single drop-in replacement for tsc.

# Check all files using tsconfig.json in the current directory
tsc-override

# Point at a specific tsconfig
tsc-override --project path/to/tsconfig.json
tsc-override -p path/to/tsconfig.json

tsc-override checks every file in the project in one pass, routing each to the correct compiler options:

| File | Options used | Errors reported | |------|-------------|-----------------| | Matches a files glob | base options + plugin compilerOptions | Yes | | Does not match any glob | base options (original tsconfig.json) | Yes |

Both programs include all project files so cross-file type inference is correct. The override options never leak into non-matched files, which is important when the override is more lenient than the base (e.g. removing strictNullChecks for a transitional directory).

Exit codes: 0 (all files passed) or 1 (errors found, or a configuration error).

Example CI integration

# .github/workflows/typecheck.yml
- run: tsc-override    # replaces tsc; also enforces per-glob overrides

How it works

The plugin creates a second TypeScript Language Service backed by a proxy LanguageServiceHost whose getCompilationSettings returns the original options merged with compilerOptions. When getSemanticDiagnostics (or getQuickInfoAtPosition) is called for a file that matches one of the files globs, the call is forwarded to this strict service instead of the original one.

The tsc-override CLI uses the same config and glob matching, but drives compilation via two ts.createProgram instances — one with base options (for non-matched files) and one with merged options (for matched files) — both including all project files for correct cross-file type inference. No subprocess is spawned.

Inspired by allegro/typescript-strict-plugin.

Caveats

  • strictNullChecks is contagious. Enabling it changes type inference for the whole program (including non-matched files), which may surface extra errors in strict files that import from non-matched ones.
  • First load is slow. The strict LanguageService builds its own Program on first use. For large projects this may take a few seconds; subsequent calls are fast.

License

MIT