@onerepo/plugin-typescript
Let oneRepo handle running TypeScript across Workspaces.
Avoid potential mistakes when using project references, this plugin will automatically ensure references across all tsconfig.json
files are kept in sync for every run.
Installation
Section titled InstallationConfiguration
Section titled Configurationtypescript()
Section titled typescript()Include the typescript
plugin in your oneRepo plugin setup:
Parameters
Section titled ParametersParameter | Type |
---|---|
opts | Options |
Options
Section titled OptionsOptions for configuring the TypeScript plugin for oneRepo.
Type declaration
Section titled Type declarationname?
Section titled name?The name of the typescript command.
tsconfig?
Section titled tsconfig?Use a different filename thant he default tsconfig.json
for type checking by default. This can always be overridden by passing --tsconfig=<filename>
as an argument to the command.
useProjectReferences?
Section titled useProjectReferences?Use TypeScript Project References. Setting to true
will automatically sync dependency project references to your tsconfig
Recommended tasks
Section titled Recommended tasksCommands
Section titled Commandsone tsc
Section titled one tscAliases: one typescript
, one typecheck
Sync TS project references
Checks for the existence of tsconfig.json
file and batches running tsc --noEmit
in each Workspace.
Option | Type | Description |
---|---|---|
--affected | boolean | Select all affected Workspaces. If no other inputs are chosen, this will default to true . |
--all, -a | boolean | Run across all Workspaces |
--pretty | boolean , default: true | Control TypeScript’s --pretty flag. |
--staged | boolean | Use files on the git stage to calculate affected files or Workspaces. When unset or --no-staged , changes will be calculated from the entire branch, since its fork point. |
--workspaces, -w | array | List of Workspace names to run against |
Advanced options
Option | Type | Description |
---|---|---|
--from-ref | string | Git ref to start looking for affected files or Workspaces |
--show-advanced | boolean | Pair with --help to show advanced options. |
--through-ref | string | Git ref to start looking for affected files or Workspaces |
--tsconfig | string , default: "tsconfig.json" | The filename of the tsconfig to find in each Workspace. |
--use-project-references, --project-references, --project-refs | boolean | Automatically sync and use typescript project references |