Angular Modernizer
    Preparing search index...

    Service DIP Violation Rule (solid:service-dip-violation) - detects concrete @Injectable constructor injection.

    Reports a constructor parameter of an @Injectable class whose type resolves (via the type checker, across files) to another @Injectable class, instead of an abstraction (interface). Provides a suggested interface name (I + injected class name) and a suggested fix. With ServiceDipViolationConfig.crossLayerOnly, only injections between different path-based layers are reported. Declaration files are skipped.

    Sibling of DIPViolationRule, which detects new MyService(). ServiceDipViolationTransformRule applies the fix.

    // Violation detected:
    class UserService {
    constructor(private orderService: OrderService) {}
    }

    // Suggested fix:
    class UserService {
    constructor(private orderService: IOrderService) {}
    }

    Implements

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

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

    Rule category for grouping.

    description: "Detects @Injectable classes injecting other @Injectable classes by concrete type instead of interface" = 'Detects @Injectable classes injecting other @Injectable classes by concrete type instead of interface'

    Rule description explaining what it checks.

    id: "solid:service-dip-violation" = 'solid:service-dip-violation'

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

    name: "Service DIP Violation" = 'Service DIP Violation'

    Human-readable rule name.

    severity: "warning" = 'warning'

    Rule severity level.

    tags: string[] = ...

    Tags for filtering and search.

    Methods