技能 编程开发 React代码审计扫描模式

React代码审计扫描模式

v20260410
react-audit-grep-patterns
该库提供了一套完整且经过验证的grep扫描指令模式,用于深度审计现有的React代码库。它对于准备升级到React 18.3.1或React 19的开发者至关重要。该模式能够全面检测弃用API、移除功能、不安全的生命周期方法以及依赖冲突,确保代码平稳过渡。
获取技能
208 次下载
概览

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"'
信息
Category 编程开发
Name react-audit-grep-patterns
版本 v20260410
大小 6.73KB
更新时间 2026-04-12
语言