{"id":51026794,"url":"https://github.com/gitstq/reactpulse","last_synced_at":"2026-06-21T20:02:21.801Z","repository":{"id":358462406,"uuid":"1241498481","full_name":"gitstq/reactpulse","owner":"gitstq","description":"A lightweight React code health scanner that detects anti-patterns and generates health scores","archived":false,"fork":false,"pushed_at":"2026-05-17T13:19:46.000Z","size":58,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-17T15:43:22.687Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gitstq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-17T13:17:47.000Z","updated_at":"2026-05-17T13:19:49.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/gitstq/reactpulse","commit_stats":null,"previous_names":["gitstq/reactpulse"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/gitstq/reactpulse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitstq%2Freactpulse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitstq%2Freactpulse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitstq%2Freactpulse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitstq%2Freactpulse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gitstq","download_url":"https://codeload.github.com/gitstq/reactpulse/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitstq%2Freactpulse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34623906,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-21T02:00:05.568Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-21T20:02:20.850Z","updated_at":"2026-06-21T20:02:21.788Z","avatar_url":"https://github.com/gitstq.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/npm/v/reactpulse?color=blue\u0026label=version\" alt=\"npm version\" /\u003e\n  \u003cimg src=\"https://img.shields.io/npm/l/reactpulse?color=green\" alt=\"license\" /\u003e\n  \u003cimg src=\"https://img.shields.io/node/v/reactpulse?color=orange\" alt=\"node version\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#简体中文\"\u003e简体中文\u003c/a\u003e | \u003ca href=\"#繁體中文\"\u003e繁體中文\u003c/a\u003e | \u003ca href=\"#english\"\u003eEnglish\u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003e💓 ReactPulse\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003e轻量级 React 代码健康度扫描器\u003c/strong\u003e\u003cbr\u003e\n  检测反模式，生成健康评分，让你的 React 代码更健康！\n\u003c/p\u003e\n\n---\n\n## 简体中文\n\n### 🎉 项目介绍\n\n**ReactPulse** 是一款轻量级的 React 代码健康度扫描工具，能够智能检测 React 项目中的常见反模式，并生成 0-100 的健康评分。\n\n**💡 灵感来源**: 受到 react-doctor 项目的启发，ReactPulse 采用完全独立自研的架构设计，提供更轻量、更易用的代码健康检测方案。\n\n**🚀 自研亮点**:\n- 🎯 **零配置启动** - 无需复杂配置，开箱即用\n- 📊 **智能评分系统** - 基于问题严重程度的加权评分算法\n- 🔍 **9 大检测规则** - 覆盖状态管理、性能、安全、可访问性等核心领域\n- 🌐 **中文友好** - 完善的中文诊断信息和建议\n- ⚡ **极速扫描** - 基于 Babel AST 的高性能解析引擎\n\n### ✨ 核心特性\n\n| 特性 | 描述 |\n|------|------|\n| 🔧 **useEffect 依赖检测** | 检测缺失的依赖数组，避免无限循环 |\n| 📦 **派生状态检测** | 识别不必要的 useState 派生状态 |\n| 🔑 **Key 属性检测** | 发现列表渲染中缺失的 key 属性 |\n| ⚡ **性能优化建议** | 检测内联函数等性能反模式 |\n| 🔒 **安全漏洞扫描** | 识别 dangerouslySetInnerHTML 等 XSS 风险 |\n| ♿ **可访问性检查** | 检测缺失的 alt 属性等问题 |\n| 🧹 **代码清理建议** | 发现 console.log 等调试代码 |\n| 🏗️ **架构问题检测** | 识别直接 DOM 操作等反模式 |\n| 🌐 **数据获取检测** | 发现 useEffect 中未清理的 fetch 调用 |\n\n### 🚀 快速开始\n\n#### 环境要求\n- Node.js \u003e= 16.0.0\n- npm 或 yarn\n\n#### 安装使用\n\n```bash\n# 在项目目录下运行\nnpx reactpulse .\n\n# 或全局安装\nnpm install -g reactpulse\nreactpulse .\n```\n\n#### 命令选项\n\n```bash\nreactpulse [directory] [options]\n\n选项:\n  -v, --verbose     显示详细输出\n  --json            输出 JSON 格式结果\n  --fail-on \u003clevel\u003e 遇到问题时退出 (error/warning/none)\n  --rules           列出所有可用规则\n  --help            显示帮助信息\n```\n\n### 📖 详细使用指南\n\n#### 配置文件\n\n在项目根目录创建 `reactpulse.config.json`:\n\n```json\n{\n  \"ignore\": {\n    \"rules\": [\"reactpulse/no-console-log\"],\n    \"files\": [\"**/generated/**\"]\n  },\n  \"rules\": {\n    \"reactpulse/no-missing-deps\": \"error\",\n    \"reactpulse/no-inline-function\": \"warning\"\n  },\n  \"failOn\": \"none\"\n}\n```\n\n#### CI/CD 集成\n\n```yaml\n# GitHub Actions 示例\nname: ReactPulse\n\non: [push, pull_request]\n\njobs:\n  scan:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - uses: actions/setup-node@v4\n        with:\n          node-version: '20'\n      - run: npx reactpulse . --fail-on error\n```\n\n### 💡 设计思路\n\nReactPulse 采用 **AST 静态分析** 技术，通过 Babel 解析器将代码转换为抽象语法树，然后遍历 AST 节点进行模式匹配和问题检测。\n\n**技术选型**:\n- **Babel Parser** - 成熟稳定的 JavaScript/TypeScript 解析器\n- **Commander** - 优雅的 CLI 框架\n- **Chalk** - 终端彩色输出\n- **cli-table3** - 表格格式化输出\n\n### 📦 打包与部署\n\n```bash\n# 构建\nnpm run build\n\n# 本地测试\nnpm link\nreactpulse .\n```\n\n### 🤝 贡献指南\n\n欢迎提交 Issue 和 Pull Request！\n\n1. Fork 本仓库\n2. 创建特性分支 (`git checkout -b feature/AmazingFeature`)\n3. 提交更改 (`git commit -m 'feat: 添加某个特性'`)\n4. 推送到分支 (`git push origin feature/AmazingFeature`)\n5. 创建 Pull Request\n\n### 📄 开源协议\n\n本项目基于 [MIT](LICENSE) 协议开源。\n\n---\n\n## 繁體中文\n\n### 🎉 專案介紹\n\n**ReactPulse** 是一款輕量級的 React 程式碼健康度掃描工具，能夠智慧檢測 React 專案中的常見反模式，並生成 0-100 的健康評分。\n\n**💡 靈感來源**: 受到 react-doctor 專案的啟發，ReactPulse 採用完全獨立自研的架構設計，提供更輕量、更易用的程式碼健康檢測方案。\n\n**🚀 自研亮點**:\n- 🎯 **零配置啟動** - 無需複雜配置，開箱即用\n- 📊 **智慧評分系統** - 基於問題嚴重程度的加權評分演算法\n- 🔍 **9 大檢測規則** - 涵蓋狀態管理、效能、安全、可存取性等核心領域\n- 🌐 **中文友善** - 完善的中文診斷訊息和建議\n- ⚡ **極速掃描** - 基於 Babel AST 的高效能解析引擎\n\n### ✨ 核心特性\n\n| 特性 | 描述 |\n|------|------|\n| 🔧 **useEffect 依賴檢測** | 檢測缺失的依賴陣列，避免無限迴圈 |\n| 📦 **衍生狀態檢測** | 識別不必要的 useState 衍生狀態 |\n| 🔑 **Key 屬性檢測** | 發現列表渲染中缺失的 key 屬性 |\n| ⚡ **效能最佳化建議** | 檢測內聯函式等效能反模式 |\n| 🔒 **安全漏洞掃描** | 識別 dangerouslySetInnerHTML 等 XSS 風險 |\n| ♿ **可存取性檢查** | 檢測缺失的 alt 屬性等問題 |\n| 🧹 **程式碼清理建議** | 發現 console.log 等除錯程式碼 |\n| 🏗️ **架構問題檢測** | 識別直接 DOM 操作等反模式 |\n| 🌐 **資料獲取檢測** | 發現 useEffect 中未清理的 fetch 呼叫 |\n\n### 🚀 快速開始\n\n#### 環境要求\n- Node.js \u003e= 16.0.0\n- npm 或 yarn\n\n#### 安裝使用\n\n```bash\n# 在專案目錄下執行\nnpx reactpulse .\n\n# 或全域安裝\nnpm install -g reactpulse\nreactpulse .\n```\n\n#### 命令選項\n\n```bash\nreactpulse [directory] [options]\n\n選項:\n  -v, --verbose     顯示詳細輸出\n  --json            輸出 JSON 格式結果\n  --fail-on \u003clevel\u003e 遇到問題時退出 (error/warning/none)\n  --rules           列出所有可用規則\n  --help            顯示說明資訊\n```\n\n### 📄 開源協議\n\n本專案基於 [MIT](LICENSE) 協議開源。\n\n---\n\n## English\n\n### 🎉 Introduction\n\n**ReactPulse** is a lightweight React code health scanner that intelligently detects common anti-patterns in React projects and generates a 0-100 health score.\n\n**💡 Inspiration**: Inspired by the react-doctor project, ReactPulse adopts a completely independent architecture design, providing a lighter and easier-to-use code health detection solution.\n\n**🚀 Highlights**:\n- 🎯 **Zero Configuration** - Works out of the box without complex setup\n- 📊 **Smart Scoring System** - Weighted scoring algorithm based on issue severity\n- 🔍 **9 Detection Rules** - Covering state management, performance, security, accessibility, and more\n- 🌐 **Developer Friendly** - Clear diagnostic messages and suggestions\n- ⚡ **Fast Scanning** - High-performance parsing engine based on Babel AST\n\n### ✨ Core Features\n\n| Feature | Description |\n|---------|-------------|\n| 🔧 **useEffect Dependency Detection** | Detect missing dependency arrays to avoid infinite loops |\n| 📦 **Derived State Detection** | Identify unnecessary useState derived state |\n| 🔑 **Key Prop Detection** | Find missing key props in list rendering |\n| ⚡ **Performance Optimization** | Detect inline functions and other anti-patterns |\n| 🔒 **Security Vulnerability Scan** | Identify XSS risks like dangerouslySetInnerHTML |\n| ♿ **Accessibility Check** | Detect missing alt attributes and other issues |\n| 🧹 **Code Cleanup Suggestions** | Find console.log and other debug code |\n| 🏗️ **Architecture Issue Detection** | Identify anti-patterns like direct DOM manipulation |\n| 🌐 **Data Fetching Detection** | Find uncleaned fetch calls in useEffect |\n\n### 🚀 Quick Start\n\n#### Requirements\n- Node.js \u003e= 16.0.0\n- npm or yarn\n\n#### Installation\n\n```bash\n# Run in your project directory\nnpx reactpulse .\n\n# Or install globally\nnpm install -g reactpulse\nreactpulse .\n```\n\n#### CLI Options\n\n```bash\nreactpulse [directory] [options]\n\nOptions:\n  -v, --verbose     Show verbose output\n  --json            Output results as JSON\n  --fail-on \u003clevel\u003e Exit with error on issues (error/warning/none)\n  --rules           List all available rules\n  --help            Show help information\n```\n\n### 📖 Usage Guide\n\n#### Configuration File\n\nCreate `reactpulse.config.json` in your project root:\n\n```json\n{\n  \"ignore\": {\n    \"rules\": [\"reactpulse/no-console-log\"],\n    \"files\": [\"**/generated/**\"]\n  },\n  \"rules\": {\n    \"reactpulse/no-missing-deps\": \"error\",\n    \"reactpulse/no-inline-function\": \"warning\"\n  },\n  \"failOn\": \"none\"\n}\n```\n\n#### CI/CD Integration\n\n```yaml\n# GitHub Actions Example\nname: ReactPulse\n\non: [push, pull_request]\n\njobs:\n  scan:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - uses: actions/setup-node@v4\n        with:\n          node-version: '20'\n      - run: npx reactpulse . --fail-on error\n```\n\n### 💡 Design Philosophy\n\nReactPulse uses **AST static analysis** technology. It converts code to an Abstract Syntax Tree through the Babel parser, then traverses AST nodes for pattern matching and issue detection.\n\n**Tech Stack**:\n- **Babel Parser** - Mature and stable JavaScript/TypeScript parser\n- **Commander** - Elegant CLI framework\n- **Chalk** - Terminal colored output\n- **cli-table3** - Table formatted output\n\n### 📦 Build \u0026 Deploy\n\n```bash\n# Build\nnpm run build\n\n# Local test\nnpm link\nreactpulse .\n```\n\n### 🤝 Contributing\n\nIssues and Pull Requests are welcome!\n\n1. Fork this repository\n2. Create a feature branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your changes (`git commit -m 'feat: add some feature'`)\n4. Push to the branch (`git push origin feature/AmazingFeature`)\n5. Create a Pull Request\n\n### 📄 License\n\nThis project is licensed under the [MIT](LICENSE) License.\n\n---\n\n\u003cp align=\"center\"\u003e\n  Made with ❤️ by \u003ca href=\"https://github.com/gitstq\"\u003egitstq\u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitstq%2Freactpulse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgitstq%2Freactpulse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitstq%2Freactpulse/lists"}