Engineering
react-doctor avatar

react-doctor

Analyze and audit React projects for security, performance, correctness, and architecture issues with actionable diagnostics and scoring.

Introduction

React Doctor is a specialized diagnostic tool for React developers seeking to improve codebase health. By scanning your project at the root level, it identifies critical vulnerabilities, architectural anti-patterns, and performance bottlenecks that might otherwise go unnoticed during standard code reviews. The tool evaluates over 47 distinct rules spanning security, state management, bundle size, and accessibility, providing a quantified score from 0 to 100 to help teams track improvements over time.

This agent is designed for frontend engineers, senior developers, and technical leads who are responsible for maintaining scalable and reliable React applications. It is particularly useful during refactoring phases, security audits, or when addressing technical debt in legacy codebases. By integrating React Doctor into your workflow, you can move from reactive bug fixing to proactive quality assurance.

  • Performs static analysis of React projects to detect common pitfalls such as hardcoded secrets, unsafe eval() usage, and inefficient useEffect hooks.

  • Audits architecture for structural issues like giant components, nested component definitions, and improper render patterns.

  • Evaluates performance metrics, including layout property animations, transition bottlenecks, and excessive blur values.

  • Analyzes bundle composition, flagging barrel imports, heavy libraries like lodash or moment.js, and missed code-splitting opportunities.

  • Provides specific feedback on Next.js-related issues, such as missing metadata, incorrect client-side fetching for server-side data, and async component errors.

  • Checks for accessibility compliance by verifying attributes like prefers-reduced-motion.

  • Identifies dead code, including unused files, exports, and types that contribute to unnecessary project bloat.

  • The tool is executed via npx -y react-doctor@latest . --verbose at the project root.

  • Results provide clear file paths and line numbers for every diagnostic, allowing for immediate remediation.

  • Workflow recommendation: run the tool, prioritize high-severity errors, resolve issues, and re-run to see the score increase.

  • Scoring system: 75-100 is considered great, 50-74 needs improvement, and 0-49 is critical.

  • Ensure you have a clean git state before applying automatic or manual fixes based on these diagnostics.

Repository Stats

Stars
333
Forks
28
Open Issues
2
Language
Shell
Default Branch
main
Sync Status
Idle
Last Synced
Apr 30, 2026, 12:13 PM
View on GitHub