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
OCP Violation Rule (
solid:ocp-violation) - detects code that has to be modified for new features (Open/Closed Principle violation).Detection patterns in class methods (
violationTypein the metadata):large-switch-statement: switch statements with more than 5 caseslong-if-else-chain: if/else chains with more than 4 branchestoo-many-parameters: methods with more than 4 parametersExample