Angular Modernizer
    Preparing search index...

    Circular Dependency Rule (solid:circular-dependency) - detects runtime import cycles between project files.

    Detection:

    • Builds a project-wide value-import graph (see ImportGraph): import type / type-only specifiers are ignored, export * from and export { x } from barrels are followed, and specifiers resolve through tsconfig path aliases, relative paths and index.ts probing.
    • Files are read from disk, not from the ts-morph project, so results do not depend on which files a scan batch currently has loaded. In-memory projects are read from the project and its file system.
    • Strongly connected components are computed with Tarjan's algorithm; each analyzed file inside a non-trivial component gets one violation with the shortest cycle through it.
    • Cycles whose edges carry DI or decorator usage (forwardRef, inject(), constructor parameter types, decorator providers / imports) are flagged ng0919Risk: true with metadata severity high (Angular NG0919: cannot read the provider/class before initialization).

    Result metadata: CircularDependencyMetadata. Graphs are cached per tsconfig for CircularDependencyRuleOptions.snapshotTtlMs.

    // Violation: service-a.ts imports service-b.ts, which imports service-a.ts
    // (directly, through an alias like '@core/...', or through an index.ts barrel)

    Implements

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    category: "solid-violation" = 'solid-violation'

    Rule category for grouping.

    description: "Detects runtime import cycles (aliases, relative paths, barrels) between project files; flags cycles that carry DI/decorator usage as NG0919 risks" = 'Detects runtime import cycles (aliases, relative paths, barrels) between project files; flags cycles that carry DI/decorator usage as NG0919 risks'

    Rule description explaining what it checks.

    id: "solid:circular-dependency" = 'solid:circular-dependency'

    Unique rule identifier (scoped to plugin). Format: "plugin-name:rule-name" (e.g., "angular-standalone:component-not-standalone")

    name: "Circular Dependency Violation" = 'Circular Dependency Violation'

    Human-readable rule name.

    severity: "error" = 'error'

    Rule severity level.

    tags: string[] = ...

    Tags for filtering and search.

    Methods