Optionalconfig: Partial<DtoDirectInstantiationConfig>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
Detects direct
new X()instantiation of DTO/Response/Result classes that should be constructed as typed object literals or via factory functions. Instantiating these classes directly bypasses type-safety checks and makes property mapping implicit rather than explicit.Detection scope:
NewExpressionnodes whose class name matches default suffix patterns (.*Response,.*Dto,.*Result), Tier 1, name-based.NewExpressionnodes whose resolved class declaration extends a configured base class or carries a configured decorator, Tier 2, AST-based.explicitClassNames, Tier 1, O(1).Skipped:
.d.tsdeclaration files.Example