What problem does it solve?
Linter-driven refactoring patterns to reduce complexity and improve code quality in React/TypeScript. Use when ESLint or SonarJS reports high cognitive, cyclomatic, or expression complexity, or when UI code is hard to read and maintain. Applies component extraction, hook extraction, and simplification patterns to structure code into clear abstractions.
Core Features & Use Cases
- Extract Custom Hook: move business logic out of components for reuse and easier testing.
- Extract Component: break large components into focused, reusable parts.
- Early Returns / Guard Clauses: reduce nesting and improve readability.
- Extract Helper Functions: isolate complex logic behind descriptive names.
- Form Validation Patterns (Zod): move validation out of UI components for consistency.
- Storifying: structure code into consistent abstraction layers (component, hook, service).
Quick Start
Refactor a complex React component by extracting a custom hook, splitting UI into focused components, and adding Zod validation.