View Source on Github

Attributes

base_config

TSConfig | None

Returns the base TSConfig that this config inherits from.

base_url

str | None

Returns the base URL defined in the TypeScript configuration.

config

dict

A dictionary containing the parsed configuration settings.

config_file

The configuration file object representing the tsconfig.json file.

config_parser

TSConfigParser

The parser used to interpret the TypeScript configuration.

out_dir

str | None

Returns the outDir defined in the TypeScript configuration.

path_import_aliases

dict[str, list[str]]

Returns a formatted version of the paths property from a TypeScript configuration file.

paths

dict[str, list[str]]

Returns all custom module path mappings defined in the tsconfig file.

reference_import_aliases

dict[str, list[str]]

Returns a formatted version of the references property from a TypeScript configuration file.

references

list[ Directory | File ]

Returns a list of directories that this TypeScript configuration file depends on.

root_dir

str | None

Returns the rootDir defined in the TypeScript configuration.

root_dirs

list[str]

Returns the rootDirs defined in the TypeScript configuration.

Methods

resolve_base_url

Resolves an import path with the base url.

View Source on Github

Returns

str

translate_absolute_path

Translates an absolute path to an import path using the tsconfig paths.

View Source on Github

Parameters

import_path
str
required

The absolute path to translate.

Returns

str

The translated import path.

translate_import_path

Translates an import path to an absolute path using the tsconfig paths.

View Source on Github

Parameters

import_path
str
required

The import path to translate.

Returns

str

The translated absolute path. If no matching path alias is found, returns the original import path unchanged.