npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

@kentcdodds/typecheck-modules

1.0.0

@kentcdodds

npmSnykSocket
Downloads:12
$ npm install @kentcdodds/typecheck-modules
DailyWeeklyMonthlyYearly

@kentcdodds/typecheck-modules

Typecheck one or more TypeScript files while resolving the TypeScript version from the target module(s), not from this CLI.

Install

npm install -D @kentcdodds/typecheck-modules

Usage

npx @kentcdodds/typecheck-modules <file|dir|glob ...>
typecheck-modules <file|dir|glob ...>
node ./cli.js <file|dir|glob ...>

Examples:

typecheck-modules ./playground
typecheck-modules ./playground/index.ts
typecheck-modules "./playground/**/*.{ts,tsx}"
typecheck-modules --ignore "**/*.test.ts" ./playground

What it does

  • Resolves typescript from the nearest node_modules above each module (using the closest package.json when available).
  • If a tsconfig.json is found, it uses those compiler options.
  • If no tsconfig.json is found, it falls back to TypeScript defaults and warns once per directory group (similar to tsc file.ts behavior).
  • Accepts directories and searches recursively for .ts and .tsx.
  • Accepts globs cross‑platform (no shell expansion required).

Ignoring files

By default, these are ignored during directory and glob expansion:

  • node_modules, .git, dist, build, out, .cache, coverage, test-output, test-results, test-reports

Provide --ignore to replace the defaults entirely:

typecheck-modules --ignore "**/*.test.ts" ./playground
typecheck-modules --ignore "**/fixtures/**" "./playground/**/*.ts"

License

MIT