ts-folder-check
v1.0.3
Published
Scoped TypeScript error checker — type-checks only the given folder(s) instead of the whole project
Maintainers
Readme
ts-folder-check
Scoped TypeScript error checker. Type-checks only the specified folder(s) instead of the whole project, so it runs much faster than a full tsc --noEmit on a large codebase or monorepo.
Install
# bun
bun add -d ts-folder-check
# npm
npm install -D ts-folder-checktypescript (6.0.3) is a dependency.
Usage
Run from the project root (where your tsconfig.json lives), passing one or more folder paths relative to the root:
ts-folder-check <folder> [folder2]... [--include <dir[,dir2]>]Examples:
bunx ts-folder-check <relative-folder-path>
# multiple folders
bunx ts-folder-check <relative-folder-path> <relative-folder-path>
# project has global .d.ts files (e.g. vite-env.d.ts) outside the target folders
bunx ts-folder-check <relative-folder-path> --include typesOr as a package.json script:
{
"scripts": {
"ts-folder-check": "ts-folder-check --include types"
}
}bun ts-folder-check <folder>
# with npm, extra arguments need "--"
npm run ts-folder-check -- <folder>Options
| Option | Description |
| ----------------- | -------------------------------------------------------------------------------------------------------- |
| --include <dir> | Extra folder(s) with global .d.ts files that must be loaded but not type-checked. Comma-separated list. |
What it does
- Uses the TypeScript Compiler API directly (no
bunx/npxspawning, so no Windows/shell issues). - Reads the nearest
tsconfig.json, so path aliases resolve correctly. - Type-checks only the files inside the target folder(s); imported files are parsed for types but not deeply checked (10x+ faster on a large project).
- Caches results incrementally in
.tscheck/— repeated runs on the same folder are faster. Add.tscheck/to your.gitignore. - Exits with code
1if errors are found,0otherwise. Config or path problems are reported clearly, never hidden.
License
MIT
