ReadonlycategoryRule category for grouping.
ReadonlydescriptionRule description explaining what it checks.
ReadonlyidUnique rule identifier (scoped to plugin). Format: "plugin-name:rule-name" (e.g., "angular-standalone:component-not-standalone")
ReadonlynameHuman-readable rule name.
ReadonlyseverityRule severity level.
ReadonlytagsTags for filtering and search.
Analyze a source file and return findings.
Analysis context with file, project, and API access
Promise resolving to array of analysis results
SRP Violation Rule (
solid:srp-single-responsibility-violation) - detects Single Responsibility Principle violations in classes.Detection patterns (
violationTypein the metadata):too-many-methods: classes with more than 15 callable members. Get/set accessors (a pair counts once) and arrow-function / function-expression properties count as methods.mixed-responsibilities: member names that fall into 3 or more responsibility categories. Base classes (abstract, or extended by 3 or more classes in the project) with at least 8 public/protected callable members are flagged at 2 categories, since every subclass inherits all concerns; metadata then carriesisBaseClass,isAbstractandsubclassCount.single-method-multi-concern: a method of 20 or more lines whose body touches 4 or more categories.Responsibility categories are matched by keywords: UI, Business, HTTP, Data, Event and Lifecycle.
Example