RORO Pattern for TypeScript & JavaScript

•
1
•

Enforces the Receive an Object, Return an Object (RORO) pattern to improve function readability, scalability, and maintainability.

This skill optimizes code architecture by prioritizing the RORO pattern, ensuring that functions with multiple parameters or return values utilize named objects instead of positional arguments or tuples. By guiding Claude to implement these structures, it enhances code clarity, makes future refactoring easier, and simplifies the management of optional parameters through destructuring and default values. This approach leads to a more robust codebase where function intents are clear and API changes are less likely to cause breaking side effects.

主要功能

011 GitHub stars
02Enforces consistent code styling across TS, TSX, JS, and JSX files
03Wraps multiple return values in descriptive objects instead of brittle tuples
04Implements clean destructuring with default values for optional arguments
05Converts multiple positional parameters into a single named object structure
06Provides smart exceptions for single parameters and standard callbacks

使用场景

01Standardizing API design for team projects to ensure clear parameter naming
02Refactoring legacy functions with long, confusing lists of positional arguments
03Improving code maintainability in rapidly evolving TypeScript applications