Angular Modernizer
    Preparing search index...

    Base context shared by all plugin operations. Contains common elements needed across analysis, transformation, and validation.

    Context objects are how capabilities reach plugins: a rule receives a context, not raw infrastructure. The context carries the public API (api) and is scoped to one operation on one source file; all fields are read-only.

    interface BaseContext<TApi = PublicApiType> {
        api: TApi;
        config: Record<string, unknown>;
        filePath: string;
        project: Project;
        sourceFile: SourceFile;
    }

    Type Parameters

    • TApi = PublicApiType

    Hierarchy (View Summary)

    Index

    Properties

    api: TApi

    The Public API - the plugin's toolbox. Contains all high-level helpers for analysis and transformation.

    This is THE critical design decision: Plugins don't implement low-level logic. They consume the API.

    config: Record<string, unknown>

    Plugin-specific configuration. Allows users to customize plugin behavior.

    filePath: string

    File path for convenience (derived from sourceFile).

    project: Project

    The ts-morph Project instance. Provides access to the entire codebase for cross-file analysis.

    sourceFile: SourceFile

    The source file being operated on. This is the primary entry point for all plugin operations.