Angular Modernizer
    Preparing search index...

    Static in Stateful Class Rule (architecture:static-in-stateful-class) - detects classes that mix public static utility methods with instance state. Static utilities should be extracted to module-level functions.

    Reports non-abstract classes that have at least one public static method and at least one instance method or property. Classes with an Angular decorator (@Component, @Injectable, @Directive, @Pipe, @NgModule) and declaration files are skipped.

    Result metadata: StaticInStatefulMetadata.

    // Violation: static utility method mixed into a stateful class
    class UserCache {
    private users = new Map<string, User>();
    static formatName(name: string): string { return name.trim(); } // Extract to utils
    }

    Implements

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    category: "architecture" = 'architecture'

    Rule category for grouping.

    description: "Detects classes that mix static utility methods with instance state — statics should be extracted to module-level functions" = 'Detects classes that mix static utility methods with instance state — statics should be extracted to module-level functions'

    Rule description explaining what it checks.

    id: "architecture:static-in-stateful-class" = 'architecture:static-in-stateful-class'

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

    name: "Static Methods in Stateful Class" = 'Static Methods in Stateful Class'

    Human-readable rule name.

    severity: "warning" = ...

    Rule severity level.

    tags: string[] = ...

    Tags for filtering and search.

    Methods