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
DIP Violation Rule (
solid:dip-violation-direct-instantiation) - detects direct service instantiation (Dependency Inversion Principle violation).Detection patterns:
new X()anywhere in the file whereXends with a service suffix (Service,Repository,Store,Manager,Api,Client,Provider,Facade,Helper,Util,Utils); metadataviolationType: 'direct-instantiation'<receiver>.get(...)where the receiver matches/injector/i; metadataviolationType: 'service-locator-pattern'Service detection matches names because the rule looks at
newexpressions, not class declarations.Example