用途:该技能面向 TypeScript/JavaScript 代码库,提供综合质量校验,覆盖格式化(Prettier)、代码检查(ESLint)、类型检查(tsc)、安全分析(npm audit)与代码复杂度分析,目标是对齐 TypeScript 最佳实践与项目规范。
主要能力:可运行格式化检查与自动修复、类型检查、lint 与自动修复、依赖漏洞审计与过期包检查、许可证检查,以及复杂度、未使用导出、导入顺序等校验,并汇总为质量报告。
使用方式:先确认 Node.js、npm、tsc、eslint、prettier 已安装,再安装开发依赖:npm install --save-dev typescript eslint prettier @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-config-prettier eslint-plugin-prettier。常用命令:npx prettier --check "src//*.{ts,tsx,js,jsx,json,css,md}"、npx prettier --write 同上、npx tsc --noEmit、npx eslint "src//*.{ts,tsx,js,jsx}"、npx eslint ... --fix、npm audit --production、npm audit fix、npm outdated、npx ts-prune。可通过 package.json scripts 组合为 quality 脚本,并接入 Husky/lint-staged 预提交钩子与 GitHub Actions CI。
适用场景:提交前质量检查、CI/CD 质量门禁、代码评审准备、样式合规与类型安全验证、依赖安全漏洞检测。
限制:需已安装上述工具与相应配置;部分修复可能涉及破坏性变更(如 npm audit fix --force),复杂度与未使用导出检查部分仅告警;具体阈值与配置可按项目调整。未提供信息:官方定价、平台支持范围等暂未提供。