@kentcdodds/typecheck-modules
v1.0.0
Published
Typecheck one or more TypeScript files while resolving the TypeScript version from the target module(s), not from this CLI.
Readme
@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-modulesUsage
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" ./playgroundWhat it does
- Resolves
typescriptfrom the nearestnode_modulesabove each module (using the closestpackage.jsonwhen available). - If a
tsconfig.jsonis found, it uses those compiler options. - If no
tsconfig.jsonis found, it falls back to TypeScript defaults and warns once per directory group (similar totsc file.tsbehavior). - Accepts directories and searches recursively for
.tsand.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
