Angular Modernizer
    Preparing search index...

    Detects direct new X() instantiation of wrapper or adapter classes (identified by name patterns, explicit class names, base class inheritance, or decorator presence) in Angular codebases.

    Direct instantiation of component-wrapper, DTO-wrapper, or adapter classes breaks the Dependency Inversion Principle: callers take responsibility for constructing the dependency rather than receiving it through Angular's DI.

    Detection scope:

    • Tier 1 (fast, name-based): classNamePatterns and explicitClassNames
    • Tier 2 (AST-based): baseClassNames and decoratorNames after import resolution

    Skipped:

    • .d.ts declaration files.
    • Classes in excludedClassNames (Angular framework Ref types by default).
    const rule = new ComponentWrapperInstantiationRule();
    const results = await rule.analyze(createContext(sourceFile, project));
    // results[0].metadata.className -> 'SomeRef'
    // results[0].metadata.detectionTier -> 1
    // results[0].metadata.detectionMechanism -> 'classNamePattern'

    Implements

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

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

    Rule category for grouping.

    description: "Detects direct new X() instantiation of component-wrapper or adapter classes that should be injected via DI" = 'Detects direct new X() instantiation of component-wrapper or adapter classes that should be injected via DI'

    Rule description explaining what it checks.

    id: "angular:component-wrapper-instantiation" = 'angular:component-wrapper-instantiation'

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

    name: "Component Wrapper Direct Instantiation" = 'Component Wrapper Direct Instantiation'

    Human-readable rule name.

    severity: "warning" = ...

    Rule severity level.

    tags: string[] = ...

    Tags for filtering and search.

    Methods