react-audit-grep-patterns

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

React Audit Grep Patterns

React审计Grep模式

Complete scan command library for React 18.3.1 and React 19 migration audits.
适用于React 18.3.1和React 19迁移审计的完整扫描命令库。

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
阅读对应目标版本的相关章节:
  • references/react18-scans.md
    - React 16/17 → 18.3.1审计的所有扫描规则
  • references/react19-scans.md
    - React 18 → 19审计的所有扫描规则
  • references/test-scans.md
    - 测试文件专属扫描规则(两类审计Agent均适用)
  • references/dep-scans.md
    - 依赖及peer依赖冲突扫描规则

Base Patterns Used Across All Scans

所有扫描通用的基础模式

bash
undefined
bash
undefined

Standard flags used throughout:

Standard flags used throughout:

-r = recursive

-r = recursive

-n = show line numbers

-n = show line numbers

-l = show filenames only (for counting affected files)

-l = show filenames only (for counting affected files)

--include=".js" --include=".jsx" = JS/JSX files only

--include=".js" --include=".jsx" = JS/JSX files only

| grep -v ".test.|.spec.|tests" = exclude test files

| grep -v ".test.|.spec.|tests" = exclude test files

| grep -v "node_modules" = safety (usually handled by not scanning node_modules)

| grep -v "node_modules" = safety (usually handled by not scanning node_modules)

2>/dev/null = suppress "no files found" errors

2>/dev/null = suppress "no files found" errors

Source files only (exclude tests):

Source files only (exclude tests):

SRC_FLAGS='--include=".js" --include=".jsx"' EXCLUDE_TESTS='grep -v ".test.|.spec.|tests"'
SRC_FLAGS='--include=".js" --include=".jsx"' EXCLUDE_TESTS='grep -v ".test.|.spec.|tests"'

Test files only:

Test files only:

TEST_FLAGS='--include=".test.js" --include=".test.jsx" --include=".spec.js" --include=".spec.jsx"'
undefined
TEST_FLAGS='--include=".test.js" --include=".test.jsx" --include=".spec.js" --include=".spec.jsx"'
undefined