Add framework decorators to the blacklist.
Use this to extend the framework decorator blacklist for custom frameworks or additional framework decorators not included by default.
Framework decorator names to add to blacklist
Auto-detect external decorators in the project.
Scans TypeScript files for decorators, filters out known framework decorators, and registers the rest as external decorators.
Algorithm:
Performance:
Absolute path to project root
Set of detected external decorator names
Clear detection cache.
Use this to force re-detection on next autoDetectDecorators() call.
Get all detected external decorators.
Map of external decorator names to definitions
Check if auto-detection has been performed.
Check if a decorator is external (not a framework decorator).
Performance: <0.1ms (Set lookup)
Decorator name (without @)
true if external, false if framework
Parse decorators on a node and classify as framework/external.
Returns parsed decorators with:
isExternal: true if external/custom decoratorisFramework: true if known framework decoratorproperties: extracted decorator argumentssource: import source if detectedPerformance: <1ms per node
ts-morph Node (ClassDeclaration, MethodDeclaration, PropertyDeclaration)
Array of parsed decorators with classification
const decorators = handler.parseDecorators(classNode);
// Filter external decorators
const external = decorators.filter(d => d.isExternal);
console.info(`External: ${external.map(d => d.name).join(', ')}`);
// Filter framework decorators
const framework = decorators.filter(d => d.isFramework);
console.info(`Framework: ${framework.map(d => d.name).join(', ')}`);
Register an external decorator manually.
Use this to override auto-detection or register decorators before detection.
External decorator definition
Handles detection and preservation of external/custom decorators.
Uses a blacklist approach:
Performance:
Compatibility:
@Component,@Injectable,@Input, etc.)