lpm check
Check TypeScript types with local tsc or managed tsgo, without JavaScript output.
Check TypeScript types before tests, builds, or releases. LPM CLI runs tsc by default and supports managed tsgo as an alternative.
lpm check [OPTIONS] [ARGS]...Quickstart
lpm install -D typescript
lpm check
lpm check --engine tsgoBoth engines receive --noEmit. The command prevents JavaScript, declaration, and source-map output. Forwarded arguments cannot disable noEmit.
Build and incremental checks can still write .tsbuildinfo caches. The command rejects configuration creation, build cleanup, and tsgo server modes.
Project configuration
Keep typescript in devDependencies to use the same compiler version in the editor and CI. Configure compiler options in tsconfig.json.
{
"compilerOptions": {
"strict": true,
"module": "nodenext",
"target": "es2022"
},
"include": ["src"]
}For the tsc engine, lpm.json can select an installed Node runtime:
{
"runtime": {
"node": "22"
}
}lpm use node@22
lpm checkThe command also reads .nvmrc and .node-version. It does not download a missing Node runtime. Use lpm use to install it.
Workspace members inherit the root's Node selection unless they select their own Node version. An unavailable selection falls back to the inherited PATH.
There is no lpm.json field to choose the check engine. tools.typescript and tools.tsgo do not pin a compiler.
Engines
| Engine | Source | Version selection |
|---|---|---|
tsc | Local node_modules/.bin, then the inherited PATH. | Your installed typescript dependency or system installation. |
tsgo | A managed native compiler, downloaded on first use. | The version bundled with LPM CLI: 7.0.0-dev.20260707.2. |
A local @typescript/native-preview dependency does not select the managed tsgo version. --engine tsgo always uses the managed installation.
Local compiler and Node lookup stop at the project or workspace root. Workspace members can use a compiler installed at the workspace root.
On Windows, .cmd shims take precedence over adjacent extensionless shell scripts. Only executable files count as available compilers.
Recipes
Use another project configuration
lpm check -- -p tsconfig.test.json
lpm check --engine tsgo -- -p packages/shared/tsconfig.jsonA bare single-project invocation searches the current directory and its ancestors for tsconfig.json. With forwarded arguments, the compiler handles configuration discovery and argument diagnostics.
Check explicit source files
lpm check -- --ignoreConfig src/index.tsIf TypeScript 6 finds a tsconfig.json, explicit source files require --ignoreConfig. Explicit-file checks do not load that configuration.
Check project references
lpm check -- --build
lpm check -- --build packages/shared packages/webPut --build first among the forwarded arguments. The selected compiler must support build mode with --noEmit.
Watch one project
lpm check -- --watch
lpm check --filter web -- --watch
lpm check -- --watch falseWatch mode requires one selected workspace member and rejects --json. TypeScript accepts a separate false value to disable watch mode.
Use a response file
--project "tsconfig.test.json"
--pretty falselpm check -- @check.argsResponse files can include nested @file references. Every relative reference uses the compiler's working directory, including references inside nested files.
LPM CLI captures response files before execution so the compiler uses the same arguments that admission checks inspect. Limits are 4 MiB of response input, 65,536 argument tokens, and 16 nested response files.
Run in CI
lpm check --json
lpm check --all --json
lpm check --filter web --fail-if-no-match --jsonThe command requires no interactive input. Install project dependencies first. For an offline tsgo run, prepare its managed installation before disconnecting.
Read compiler help
lpm check -- --help
lpm check -- --version
lpm check --engine tsgo -- --helpThe selected engine does not need a tsconfig.json to show help or its version.
Workspaces
lpm check --all
lpm check --filter web --filter shared
lpm check --filter './packages/*'
lpm check --filter-prod '...web'
lpm check --affected --base origin/mainEach selected member runs from its own directory. Selected dependencies finish before their dependents start. Independent members run concurrently, up to the host CPU count.
--all conflicts with filters and --affected. Filters and --affected combine their selections.
An empty selection succeeds without a check. If a selected member must exist, add --fail-if-no-match. Watch mode requires a nonempty selection.
See workspace filters for dependency closures, exclusions, path patterns, and Git references.
JSON and exit codes
Single-project and workspace runs emit one JSON object. Completed runs contain member results, exit codes, and durations. Failed members include captured diagnostics.
Preparation failures can return the standard error object before member results exist. Examples include missing configuration, unreadable response files, and unavailable compilers or runtimes.
See the lpm lint JSON example for the envelope shape. Successful members omit captured output.
LPM CLI retains at most 10 MiB per output stream and marks truncated diagnostics. A launch failure has exit_code: null and an error message.
Single-project runs preserve the compiler's exit code. Workspace runs exit 1 if any member fails. On Unix, interruption stops active descendants and exits 130 for SIGINT or 143 for SIGTERM.
Recovery
If TypeScript is missing, install it:
lpm install -D typescriptIf typescript is already declared, run lpm install. If Node cannot start, install a compatible runtime with lpm use.
If no configuration exists, create tsconfig.json or pass -p <path>. Use the compiler diagnostics to correct type errors and unsupported options.
lpm doctor reports whether a local or system compiler is available. It does not perform a type check.
Flags
| Flag | Effect |
|---|---|
--engine <ENGINE> | Compiler: tsc or tsgo. Default: tsc. |
--all | Run in every workspace member. Conflicts with filters and --affected. |
--filter <FILTER> | Select members with a repeatable workspace filter. |
--filter-prod <FILTER_PROD> | Select members with production-only dependency closures. |
--affected | Select changed members and their affected dependents. |
--base <BASE> | Git base for --affected. Default: main. |
--changed-files-ignore-pattern <PATTERN> | Ignore matching changed paths. Repeatable. |
--test-pattern <PATTERN> | Treat matching changes as tests when calculating dependent selection. Repeatable. |
--fail-if-no-match | Fail when the workspace selection is empty. |
[ARGS]... | Compiler arguments. Use -- to separate them from LPM CLI flags. |
See global flags for --json and other shared options.
See also
lpm lint— find code problems with Oxlint.lpm fmt— format code with Biome.lpm test— run project tests.lpm plugin— inspect managed tools and engines.lpm use— install and select Node or Bun.