# typecheck Runs the TypeScript compiler over a project without emitting files: its library configuration and, when the project has one, its spec configuration. Specs run with their types stripped, so this is the one step that type checks them. ```json { "typecheck": { "executor": "@hyperfrontend/workspace:typecheck" } } ``` | Option | What it does | | ---------------- | ----------------------------------------------------------------------------------------------- | | `--tsConfig` | The library configuration; defaults to `tsconfig.lib.json` in the project | | `--specTsConfig` | The spec configuration; defaults to `tsconfig.spec.json` in the project, checked when it exists | ## API Reference ### Functions #### typecheckExecutor ```typescript function typecheckExecutor(options: TypecheckExecutorOptions, context: ExecutorContext): Promise ``` Typecheck executor for the projects of a workspace. Runs the TypeScript compiler in --noEmit mode over the library config and, when the project has one, the spec config. Specs run with their types stripped, so this is the only step that type checks them. **Parameters** | Name | Type | Description | | --- | --- | --- | | `options` | `TypecheckExecutorOptions` | Executor options including the tsconfig paths | | `context` | `ExecutorContext` | The workspace, the project and the target the task runs on | **Returns** `Promise`: An object indicating success or failure of the type check **Example: A `typecheck` target with the default configurations** ```json { "targets": { "typecheck": { "executor": "@hyperfrontend/workspace:typecheck" } } } ``` `npx hf run lib-core:typecheck` checks `libs/core/tsconfig.lib.json`, then `libs/core/tsconfig.spec.json` when that file exists; `--tsConfig=libs/core/tsconfig.json` names another. ### Interfaces #### TypecheckExecutorOptions Schema types for the typecheck executor. **Properties** | Name | Type | Description | | --- | --- | --- | | `tsConfig?` | `string` | Path to the library TypeScript configuration file, relative to the workspace root. Defaults to {projectRoot}/tsconfig.lib.json. | | `specTsConfig?` | `string` | Path to the spec TypeScript configuration file, relative to the workspace root. Defaults to {projectRoot}/tsconfig.spec.json, checked when that file exists. | --- Canonical page: https://www.hyperfrontend.dev/docs/libraries/workspace/executors/typecheck/ This file: https://www.hyperfrontend.dev/docs/libraries/workspace/executors/typecheck.md Documentation index: https://www.hyperfrontend.dev/llms.txt