跳到正文
Skillpedia
网站与界面(前端)40k · #7381

react-audit-grep-patterns

它能做什么

这组命令可以帮你在把 React 代码升级到新版本(18.3.1 或 19)之前,先检查一遍代码。它会查找代码中可能需要调整的部分。

适用场景

  • ✓当你计划升级 React 项目时。
  • ✓当你想确认旧代码在新版本中仍能正常运行时。
  • ✓当你想找出测试文件中的特定问题时。

技能链接

https://github.com/github/awesome-copilot/blob/main/skills/react-audit-grep-patterns/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/github/awesome-copilot/blob/main/skills/react-audit-grep-patterns/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我想为升级到 React 19 做一次代码检查,应该怎么做?”

每周 5 个新技能,1 分钟读完。

工作原理

它使用一个叫 grep 的工具,在你的所有代码文件中搜索特定的文本模式。它知道该查找哪些模式,比如旧的函数或兼容性问题。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

React Audit Grep Patterns

Complete scan command library for React 18.3.1 and React 19 migration audits.

Usage

Read the relevant section for your target:

  • references/react18-scans.md - all scans for React 16/17 → 18.3.1 audit
  • references/react19-scans.md - all scans for React 18 → 19 audit
  • references/test-scans.md - test file specific scans (used by both auditors)
  • references/dep-scans.md - dependency and peer conflict scans

Base Patterns Used Across All Scans

# Standard flags used throughout:
# -r = recursive
# -n = show line numbers
# -l = show filenames only (for counting affected files)
# --include="*.js" --include="*.jsx" = JS/JSX files only
# | grep -v "\.test\.\|\.spec\.\|__tests__" = exclude test files
# | grep -v "node_modules" = safety (usually handled by not scanning node_modules)
# 2>/dev/null = suppress "no files found" errors

# Source files only (exclude tests):
SRC_FLAGS='--include="*.js" --include="*.jsx"'
EXCLUDE_TESTS='grep -v "\.test\.\|\.spec\.\|__tests__"'

# Test files only:
TEST_FLAGS='--include="*.test.js" --include="*.test.jsx" --include="*.spec.js" --include="*.spec.jsx"'
常见问题

什么是“grep 扫描”?

这是一种同时在大量代码文件中搜索特定文本的方法。

为什么升级前要先检查代码?

新版本的软件可能会修改或删除一些旧的部分,如果你不做相应调整,代码就可能出错。

什么是 API?

API 就像 React 提供给你在代码里使用的“命令”或“工具”。其中一些在新版本中可能会被删除或修改。

详情

作者的原始描述

Provides the complete, verified grep scan command library for auditing React codebases before a React 18.3.1 or React 19 upgrade. Use this skill whenever running a migration audit - for both the react18-auditor and react19-auditor agents. Contains every grep pattern needed to find deprecated APIs, removed APIs, unsafe lifecycle methods, batching vulnerabilities, test file issues, dependency confli

repo: github/awesome-copilot

热度

GitHub 星标
40k
排名
#7381
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能