Multi-Framework Frontend Code Health Diagnostic CLI Tool
Vue · React · Svelte · Angular — One Command, Full Health Check
FrameDoctor 是一款轻量级、零运行时依赖的多框架前端代码健康诊断 CLI 工具。只需一条命令,即可对 Vue 2/3、React、Svelte、Angular 项目进行全面的代码质量扫描,输出 0-100 分的健康评分及可操作的诊断建议。
受 GitHub Trending 热门项目 react-doctor(7.6k+ stars)启发,FrameDoctor 在其核心理念基础上进行了全面差异化升级:
| 特性 | 描述 |
|---|---|
| 🌐 多框架支持 | Vue 2/3、React、Svelte、Angular 四大主流前端框架 |
| ⚡ 零依赖 | 仅依赖 Node.js 内置模块,安装体积极小 |
| 🔍 40+ 诊断规则 | 覆盖性能、安全、正确性、架构、可访问性、最佳实践、死代码 |
| 📊 健康评分 | 0-100 分量化评分 + A-F 等级,一目了然 |
| 🏗️ 自动检测 | 自动识别框架类型、版本、包管理器、构建工具 |
| 🧹 死代码检测 | 发现未使用的导入、变量、注释代码块 |
| 📋 多格式输出 | 支持终端彩色输出和 JSON 格式报告 |
| 🎯 灵活过滤 | 按类别、严重程度过滤,精准定位问题 |
| 🧪 内置测试 | 16 个单元测试,确保核心引擎稳定可靠 |
# 全局安装(推荐)
npm install -g framedoctor
# 或使用 npx 直接运行(无需安装)
npx framedoctor .
# 克隆仓库
git clone https://github.com/gitstq/FrameDoctor.git
cd FrameDoctor
# 安装依赖
npm install
# 编译 TypeScript
npm run build
# 运行测试
npm test
# 扫描当前项目
node dist/index.js .
# 扫描当前目录
framedoctor .
# 扫描指定项目
framedoctor ./my-vue-project
# 仅检查安全和性能问题
framedoctor . --categories security,performance
# 仅显示错误级别问题
framedoctor . --min-severity error
# 输出 JSON 格式报告并保存到文件
framedoctor . --output json --file report.json
# 忽略特定目录
framedoctor . --ignore dist,build,generated
| 参数 | 简写 | 说明 | 示例 |
|---|---|---|---|
--output |
-o |
输出格式:text(默认)或 json |
-o json |
--file |
-f |
将 JSON 报告保存到指定文件 | -f report.json |
--categories |
-c |
仅检查指定类别(逗号分隔) | -c security,performance |
--min-severity |
-s |
最低严重程度:error、warn、info |
-s warn |
--no-dead-code |
-d |
跳过死代码检测 | -d |
--ignore |
-i |
额外的忽略模式(逗号分隔) | -i dist,build |
--verbose |
-v |
显示详细输出 | -v |
--help |
-h |
显示帮助信息 | -h |
--version |
-V |
显示版本号 | -V |
| 类别 | 说明 | 规则数 |
|---|---|---|
| ⚡ Performance | 性能优化建议 | 9 |
| 🔒 Security | 安全漏洞检测 | 6 |
| ✅ Correctness | 代码正确性检查 | 7 |
| 🏗️ Architecture | 架构设计建议 | 6 |
| ♿ Accessibility | 可访问性检查 | 5 |
| 📋 Best Practices | 最佳实践建议 | 8 |
| 🧹 Dead Code | 死代码检测 | 4 |
import { diagnose } from 'framedoctor';
// 运行诊断
const report = diagnose('./my-project');
console.log(`健康评分: ${report.healthScore}/100 (${report.grade})`);
console.log(`检测到 ${report.issues.length} 个问题`);
console.log(`扫描了 ${report.filesScanned} 个文件`);
FrameDoctor 的核心设计理念是零门槛、零配置、多框架。我们相信代码质量检查不应该需要繁琐的配置过程,开发者应该能够一条命令就获得有价值的诊断结果。
--fix):自动修复常见问题# 全局安装
npm install -g framedoctor
# 在项目中使用
npm install framedoctor
FrameDoctor 是一个纯 CLI 工具,无需打包部署。编译后的 dist/ 目录可直接运行:
# 编译
npm run build
# 运行
node dist/index.js <project-path>
| 环境 | 最低版本 |
|---|---|
| Node.js | >= 18.0.0 |
| 操作系统 | Windows / macOS / Linux |
| 包管理器 | npm / yarn / pnpm / bun |
欢迎贡献代码!请遵循以下规范:
git checkout -b feature/my-featuregit commit -m "feat: add my feature"git push origin feature/my-feature遵循 Angular 提交规范:
feat: 新增功能fix: 修复问题docs: 文档更新refactor: 代码重构test: 测试相关chore: 构建/工具链更新发现 Bug 或有功能建议?请 提交 Issue。
本项目基于 MIT License 开源。
FrameDoctor 是一款輕量級、零執行期依賴的多框架前端程式碼健康診斷 CLI 工具。只需一條命令,即可對 Vue 2/3、React、Svelte、Angular 專案進行全面的程式碼品質掃描,輸出 0-100 分的健康評分及可操作的診斷建議。
受 GitHub Trending 熱門專案 react-doctor(7.6k+ stars)啟發,FrameDoctor 在其核心理念基礎上進行了全面差異化升級:
| 特性 | 描述 |
|---|---|
| 🌐 多框架支援 | Vue 2/3、React、Svelte、Angular 四大主流前端框架 |
| ⚡ 零依賴 | 僅依賴 Node.js 內建模組,安裝體積極小 |
| 🔍 40+ 診斷規則 | 涵蓋效能、安全、正確性、架構、可訪問性、最佳實踐、死程式碼 |
| 📊 健康評分 | 0-100 分量化評分 + A-F 等級,一目了然 |
| 🏗️ 自動偵測 | 自動識別框架類型、版本、套件管理器、建置工具 |
| 🧹 死程式碼偵測 | 發現未使用的匯入、變數、註解程式碼區塊 |
| 📋 多格式輸出 | 支援終端彩色輸出和 JSON 格式報告 |
| 🎯 靈活過濾 | 按類別、嚴重程度過濾,精準定位問題 |
| 🧪 內建測試 | 16 個單元測試,確保核心引擎穩定可靠 |
# 全域安裝(推薦)
npm install -g framedoctor
# 或使用 npx 直接執行(無需安裝)
npx framedoctor .
# 克隆倉庫
git clone https://github.com/gitstq/FrameDoctor.git
cd FrameDoctor
# 安裝依賴
npm install
# 編譯 TypeScript
npm run build
# 執行測試
npm test
# 掃描當前專案
node dist/index.js .
# 掃描當前目錄
framedoctor .
# 掃描指定專案
framedoctor ./my-vue-project
# 僅檢查安全和效能問題
framedoctor . --categories security,performance
# 僅顯示錯誤級別問題
framedoctor . --min-severity error
# 輸出 JSON 格式報告並儲存到檔案
framedoctor . --output json --file report.json
# 忽略特定目錄
framedoctor . --ignore dist,build,generated
| 參數 | 簡寫 | 說明 | 範例 |
|---|---|---|---|
--output |
-o |
輸出格式:text(預設)或 json |
-o json |
--file |
-f |
將 JSON 報告儲存到指定檔案 | -f report.json |
--categories |
-c |
僅檢查指定類別(逗號分隔) | -c security,performance |
--min-severity |
-s |
最低嚴重程度:error、warn、info |
-s warn |
--no-dead-code |
-d |
跳過死程式碼偵測 | -d |
--ignore |
-i |
額外的忽略模式(逗號分隔) | -i dist,build |
--verbose |
-v |
顯示詳細輸出 | -v |
--help |
-h |
顯示說明資訊 | -h |
--version |
-V |
顯示版本號 | -V |
| 類別 | 說明 | 規則數 |
|---|---|---|
| ⚡ Performance | 效能最佳化建議 | 9 |
| 🔒 Security | 安全漏洞偵測 | 6 |
| ✅ Correctness | 程式碼正確性檢查 | 7 |
| 🏗️ Architecture | 架構設計建議 | 6 |
| ♿ Accessibility | 可訪問性檢查 | 5 |
| 📋 Best Practices | 最佳實踐建議 | 8 |
| 🧹 Dead Code | 死程式碼偵測 | 4 |
import { diagnose } from 'framedoctor';
// 執行診斷
const report = diagnose('./my-project');
console.log(`健康評分: ${report.healthScore}/100 (${report.grade})`);
console.log(`偵測到 ${report.issues.length} 個問題`);
console.log(`掃描了 ${report.filesScanned} 個檔案`);
FrameDoctor 的核心設計理念是零門檻、零配置、多框架。我們相信程式碼品質檢查不應該需要繁瑣的配置過程,開發者應該能夠一條命令就獲得有價值的診斷結果。
--fix):自動修復常見問題# 全域安裝
npm install -g framedoctor
# 在專案中使用
npm install framedoctor
FrameDoctor 是一個純 CLI 工具,無需打包部署。編譯後的 dist/ 目錄可直接執行:
# 編譯
npm run build
# 執行
node dist/index.js <project-path>
| 環境 | 最低版本 |
|---|---|
| Node.js | >= 18.0.0 |
| 作業系統 | Windows / macOS / Linux |
| 套件管理器 | npm / yarn / pnpm / bun |
歡迎貢獻程式碼!請遵循以下規範:
git checkout -b feature/my-featuregit commit -m "feat: add my feature"git push origin feature/my-feature遵循 Angular 提交規範:
feat: 新增功能fix: 修復問題docs: 文件更新refactor: 程式碼重構test: 測試相關chore: 建置/工具鏈更新發現 Bug 或有功能建議?請 提交 Issue。
本專案基於 MIT License 開源。
FrameDoctor is a lightweight, zero-runtime-dependency CLI tool for multi-framework frontend code health diagnostics. With a single command, it scans Vue 2/3, React, Svelte, and Angular projects for comprehensive code quality analysis, outputting a 0-100 health score with actionable diagnostic suggestions.
Inspired by the trending GitHub project react-doctor (7.6k+ stars), FrameDoctor delivers a comprehensive differentiated upgrade:
| Feature | Description |
|---|---|
| 🌐 Multi-Framework | Vue 2/3, React, Svelte, Angular — all major frontend frameworks |
| ⚡ Zero Dependencies | Only Node.js built-in modules, minimal install size |
| 🔍 40+ Rules | Performance, security, correctness, architecture, accessibility, best practices, dead code |
| 📊 Health Score | Quantified 0-100 score + A-F grade at a glance |
| 🏗️ Auto-Detection | Identifies framework, version, package manager, and build tool |
| 🧹 Dead Code Detection | Finds unused imports, variables, commented-out code blocks |
| 📋 Multi-Format Output | Terminal colored output and JSON format reports |
| 🎯 Flexible Filtering | Filter by category and severity for precise issue targeting |
| 🧪 Built-in Tests | 16 unit tests ensuring core engine reliability |
# Global install (recommended)
npm install -g framedoctor
# Or run directly with npx (no install needed)
npx framedoctor .
# Clone the repository
git clone https://github.com/gitstq/FrameDoctor.git
cd FrameDoctor
# Install dependencies
npm install
# Build TypeScript
npm run build
# Run tests
npm test
# Scan current project
node dist/index.js .
# Scan current directory
framedoctor .
# Scan a specific project
framedoctor ./my-vue-project
# Only check security and performance
framedoctor . --categories security,performance
# Only show error-level issues
framedoctor . --min-severity error
# Output JSON report and save to file
framedoctor . --output json --file report.json
# Ignore specific directories
framedoctor . --ignore dist,build,generated
| Option | Short | Description | Example |
|---|---|---|---|
--output |
-o |
Output format: text (default) or json |
-o json |
--file |
-f |
Save JSON report to file | -f report.json |
--categories |
-c |
Only check specific categories (comma-separated) | -c security,performance |
--min-severity |
-s |
Minimum severity: error, warn, info |
-s warn |
--no-dead-code |
-d |
Skip dead code detection | -d |
--ignore |
-i |
Additional ignore patterns (comma-separated) | -i dist,build |
--verbose |
-v |
Show verbose output | -v |
--help |
-h |
Show help information | -h |
--version |
-V |
Show version number | -V |
| Category | Description | Rules |
|---|---|---|
| ⚡ Performance | Performance optimization suggestions | 9 |
| 🔒 Security | Security vulnerability detection | 6 |
| ✅ Correctness | Code correctness checks | 7 |
| 🏗️ Architecture | Architecture design suggestions | 6 |
| ♿ Accessibility | Accessibility checks | 5 |
| 📋 Best Practices | Best practice recommendations | 8 |
| 🧹 Dead Code | Dead code detection | 4 |
import { diagnose } from 'framedoctor';
// Run diagnostics
const report = diagnose('./my-project');
console.log(`Health Score: ${report.healthScore}/100 (${report.grade})`);
console.log(`Found ${report.issues.length} issues`);
console.log(`Scanned ${report.filesScanned} files`);
FrameDoctor's core design principle is zero-barrier, zero-config, multi-framework. We believe code quality checks shouldn't require complex setup — developers should get valuable diagnostic insights with a single command.
--fix): Automatically fix common issues# Global install
npm install -g framedoctor
# Use in a project
npm install framedoctor
FrameDoctor is a pure CLI tool — no build/deployment needed. The compiled dist/ directory is ready to run:
# Build
npm run build
# Run
node dist/index.js <project-path>
| Environment | Minimum Version |
|---|---|
| Node.js | >= 18.0.0 |
| OS | Windows / macOS / Linux |
| Package Manager | npm / yarn / pnpm / bun |
Contributions are welcome! Please follow these guidelines:
git checkout -b feature/my-featuregit commit -m "feat: add my feature"git push origin feature/my-featureFollow the Angular commit convention:
feat: New featurefix: Bug fixdocs: Documentation updaterefactor: Code refactoringtest: Test-related changeschore: Build/tooling updatesFound a bug or have a feature request? Please open an issue.
This project is licensed under the MIT License.
Built with ❤️ by FrameDoctor Team