@hyperfrontend/workspace/executors/typecheck

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.

{
  "typecheck": {
    "executor": "@hyperfrontend/workspace:typecheck"
  }
}
OptionWhat it does
--tsConfigThe library configuration; defaults to tsconfig.lib.json in the project
--specTsConfigThe spec configuration; defaults to tsconfig.spec.json in the project, checked when it exists

API Reference§

ƒ Functions

§function

typecheckExecutor(options: TypecheckExecutorOptions, context: ExecutorContext): Promise<ExecutorResult>

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
NameTypeDescription
§options
TypecheckExecutorOptionsExecutor options including the tsconfig paths
§context
ExecutorContextThe workspace, the project and the target the task runs on
Returns
Promise<ExecutorResult>
An object indicating success or failure of the type check
Example

A `typecheck` target with the default configurations

{
  "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

§interface

TypecheckExecutorOptions

Schema types for the typecheck executor.
Properties
§tsConfig?:stringPath to the library TypeScript configuration file, relative to the workspace root. Defaults to {projectRoot}/tsconfig.lib.json.
§specTsConfig?:stringPath to the spec TypeScript configuration file, relative to the workspace root. Defaults to {projectRoot}/tsconfig.spec.json, checked when that file exists.