Angular Modernizer
    Preparing search index...

    Detects .instance accesses on ComponentRef-typed expressions that lack an explicit type contract. Dynamic component hosts that access component members through an untyped (or any-typed) ComponentRef create implicit contracts that the TypeScript compiler cannot verify.

    Detection scope:

    • PropertyAccessExpression nodes whose name is instance and whose expression resolves to a type that includes ComponentRef.
    • Only flagged when the .instance access is itself chained with a member access (.instance.memberName), indicating an actual contract use.

    Skipped:

    • .d.ts declaration files.
    • ComponentRef<T> where T is a concrete (non-any, non-unknown) named type: the contract is already explicit.
    • Accesses preceded by a type assertion (as IMyInterface or <IMyInterface>), which means the developer has opted in to explicit typing at the call site.
    • Event member accesses when checkEventSubscriptions config option is false.
    const rule = new UntypedDynamicComponentRule();
    const results = await rule.analyze(createContext(sourceFile, project));
    // results[0].metadata.accessedMember -> 'setData'
    // results[0].metadata.memberType -> 'method'
    // results[0].metadata.isFullyUntyped -> true

    Implements

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    category: "angular-architecture" = 'angular-architecture'

    Rule category for grouping.

    description: "Detects untyped .instance access on ComponentRef without explicit type contracts" = 'Detects untyped .instance access on ComponentRef without explicit type contracts'

    Rule description explaining what it checks.

    id: "angular:untyped-dynamic-component" = 'angular:untyped-dynamic-component'

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

    name: "Implicit Contract" = 'Implicit Contract'

    Human-readable rule name.

    severity: "warning" = ...

    Rule severity level.

    tags: string[] = ...

    Tags for filtering and search.

    Methods