Angular Modernizer
    Preparing search index...

    Import Direction Violation Rule (solid:import-direction-violation) - detects imports that cross conventional layer boundaries.

    Works without configuration: layers are inferred from path segments and tsconfig path aliases. Reports (violationType in the metadata):

    • forbidden-import-pattern: built-in forbidden directions (features importing shared or core, also through relative paths; libraries importing app or feature code)
    • layer-hierarchy: imports that go down the built-in order app > features > config > shared > core/lib/libs > assets/environments; imports from app, config and shared are exempt

    An import that matches a forbidden pattern is reported once, not also as a hierarchy violation. Layers are read from whole words of path segments and aliases. External packages and files whose layer cannot be determined are skipped.

    When the project configures a layer topology (layers or layersSource) the rule reports nothing: the config-driven LayerBoundaryViolationRule checks the imports against it.

    // Violation: a feature imports shared code
    // features/orders/order-list.component.ts imports from '@shared/format'

    Implements

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

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

    Rule category for grouping.

    description: "Detects imports that violate architectural layer boundaries" = 'Detects imports that violate architectural layer boundaries'

    Rule description explaining what it checks.

    id: "solid:import-direction-violation" = 'solid:import-direction-violation'

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

    name: "Import Direction Violation" = 'Import Direction Violation'

    Human-readable rule name.

    severity: "error" = 'error'

    Rule severity level.

    tags: string[] = ...

    Tags for filtering and search.

    Methods