Angular Modernizer
    Preparing search index...

    Content Placement Rule (architecture:content-placement) - validates file placement against the layer topology.

    Checks that services, components, guards, interceptors, directives, pipes, models and utilities live in a layer allowed for their content type. Layer membership comes from layers / layersSource (never from folder names), the allowed layers per content type from rules['architecture:content-placement'].placement (layer names or aliases). Without either the rule reports nothing. Barrel files (index.ts, public-api.ts, exports.ts), specs, tests, config and declaration files are skipped. Paths are anchored at config.projectRoot, else the plugin's project root, else the directory of the loaded tsconfig.

    Result metadata: ContentPlacementMetadata.

    // .angular-modernizer.json
    {
    "layers": [ ... ],
    "rules": {
    "architecture:content-placement": {
    "placement": { "service": ["@core", "@shared"], "guard": ["@core"] }
    }
    }
    }

    Implements

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    category: "architecture-violation" = 'architecture-violation'

    Rule category for grouping.

    description: "Validates that files are placed in the layers configured for their content type (layers + rules placement map)" = 'Validates that files are placed in the layers configured for their content type (layers + rules placement map)'

    Rule description explaining what it checks.

    id: "architecture:content-placement" = 'architecture:content-placement'

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

    name: "Content Placement" = 'Content Placement'

    Human-readable rule name.

    severity: "warning" = 'warning'

    Rule severity level.

    tags: string[] = ...

    Tags for filtering and search.

    Methods