Typecheck one or more TypeScript files while resolving the TypeScript version from the target module(s), not from this CLI.
npm install @kentcdodds/typecheck-modulesTypecheck one or more TypeScript files while resolving the TypeScript version
from the target module(s), not from this CLI.
``sh`
npm install -D @kentcdodds/typecheck-modules
`sh`
npx @kentcdodds/typecheck-modules
typecheck-modules
node ./cli.js
Examples:
`sh`
typecheck-modules ./playground
typecheck-modules ./playground/index.ts
typecheck-modules "./playground/*/.{ts,tsx}"
typecheck-modules --ignore "*/.test.ts" ./playground
- Resolves typescript from the nearest node_modules above each modulepackage.json
(using the closest when available).tsconfig.json
- If a is found, it uses those compiler options.tsconfig.json
- If no is found, it falls back to TypeScript defaults andtsc file.ts
warns once per directory group (similar to behavior)..ts
- Accepts directories and searches recursively for and .tsx.
- Accepts globs cross‑platform (no shell expansion required).
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:
`sh``
typecheck-modules --ignore "*/.test.ts" ./playground
typecheck-modules --ignore "/fixtures/" "./playground/*/.ts"
MIT