TsconfigAPI Reference
API Reference
Last updated:
API Reference
findTsConfig()
Find tsconfig.json file.
Signature:
function findTsConfig(cwd?: string): Promise<{
path: string;
config: TsConfig;
} | null>readTsConfig()
Read and parse tsconfig.json file.
Signature:
function readTsConfig(
path: string,
options?: { tscCompatible?: boolean }
): Promise<TsConfig>Options:
tscCompatible- Parse in TypeScript compiler compatible mode
writeTsConfig()
Write tsconfig.json file.
Signature:
function writeTsConfig(
config: TsConfig,
options?: { cwd?: string }
): Promise<void>Options:
cwd- Directory to write tsconfig.json
TsConfig Type
interface TsConfig {
extends?: string | string[];
compilerOptions?: CompilerOptions;
include?: string[];
exclude?: string[];
files?: string[];
references?: ProjectReference[];
// ... all TypeScript config options
}