Angular Modernizer
    Preparing search index...

    Context for analysis operations. Passed to AnalysisRule.analyze() methods.

    Analysis contexts are READ-ONLY. They must not modify code.

    interface AnalysisContext<TApi = PublicApiType> {
        api: TApi;
        config: Record<string, unknown>;
        filePath: string;
        options?: { deep?: boolean; maxDepth?: number };
        project: Project;
        sourceFile: SourceFile;
        type: "analysis";
    }

    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).

    options?: { deep?: boolean; maxDepth?: number }

    Analysis-specific options.

    Type Declaration

    • Optionaldeep?: boolean

      Whether to perform deep analysis (cross-file). Default: false (single-file analysis only)

    • OptionalmaxDepth?: number

      Maximum depth for cross-file analysis. Only relevant if deep=true.

    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.

    type: "analysis"

    Type discriminator for type safety.