Index of every page on this site: llms.txt
All skills
github avatar

/react-audit-grep-patterns

@f10fdb8 official
by githubgithub/awesome-copilot42k stars
5,426
Run it yourself

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 conflicts, and React 19 specific removals. Always use this skill when writing audit scan commands - do not rely on memory for grep syntax, especially for the multi-line async setState patterns which require context flags.

Use this Skill: https://skilld.dev/gh/github/awesome-copilot/react-audit-grep-patterns

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencestest-scans.md

≈616 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Test File Scans - Both Auditors

Scans specifically for test file issues. Run during both R18 and R19 audits.


Setup Files

# Find test setup files
find src/ -name "setupTests*" -o -name "jest.setup*" 2>/dev/null
find . -name "jest.config.js" -o -name "jest.config.ts" 2>/dev/null | grep -v "node_modules"

# Check setup file for legacy patterns
grep -n "ReactDOM\|react-dom/test-utils\|Enzyme\|configure\|Adapter" \
  src/setupTests.js 2>/dev/null

Import Scans

# All react-dom/test-utils imports in tests
grep -rn "from 'react-dom/test-utils'\|require.*react-dom/test-utils" \
  src/ --include="*.test.*" --include="*.spec.*" 2>/dev/null

# Enzyme imports
grep -rn "from 'enzyme'\|require.*enzyme" \
  src/ --include="*.test.*" --include="*.spec.*" 2>/dev/null

# react-test-renderer
grep -rn "from 'react-test-renderer'" \
  src/ --include="*.test.*" --include="*.spec.*" 2>/dev/null

# Old act location
grep -rn "act.*from 'react-dom'" \
  src/ --include="*.test.*" --include="*.spec.*" 2>/dev/null

Render Pattern Scans

# ReactDOM.render in tests (should use RTL render)
grep -rn "ReactDOM\.render\s*(" \
  src/ --include="*.test.*" --include="*.spec.*" 2>/dev/null

# Enzyme shallow/mount
grep -rn "shallow(\|mount(" \
  src/ --include="*.test.*" --include="*.spec.*" 2>/dev/null

# Custom render helpers
find src/ -name "test-utils.js" -o -name "renderWithProviders*" \
  -o -name "customRender*" -o -name "render-helpers*" 2>/dev/null

Assertion Scans

# Call count assertions (StrictMode sensitive)
grep -rn "toHaveBeenCalledTimes" \
  src/ --include="*.test.*" --include="*.spec.*" 2>/dev/null

# console.error assertions (React error logging changed in R19)
grep -rn "console\.error" \
  src/ --include="*.test.*" --include="*.spec.*" 2>/dev/null

# Intermediate state assertions (batching sensitive)
grep -rn "fireEvent\|userEvent" \
  src/ --include="*.test.*" --include="*.spec.*" -A 1 \
  | grep "expect\|getBy\|queryBy" | head -20 2>/dev/null

Async Scans

# act() usage
grep -rn "\bact(" \
  src/ --include="*.test.*" --include="*.spec.*" 2>/dev/null

# waitFor usage (good - check these are properly async)
grep -rn "waitFor\|findBy" \
  src/ --include="*.test.*" --include="*.spec.*" | wc -l

# setTimeout in tests (may be batching-sensitive)
grep -rn "setTimeout\|setInterval" \
  src/ --include="*.test.*" --include="*.spec.*" 2>/dev/null

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts2mo4 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    The skill provides a collection of utility commands and grep patterns used for auditing React codebases during version migrations. It employs standard command-line tools to identify deprecated APIs and dependency conflicts. No malicious behavior was detected.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at f10fdb8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 4 days ago.

Activeupdated 7 months ago

README badge

README badge for github/awesome-copilot/react-audit-grep-patterns

Provides grep commands for auditing React codebases before upgrading to React 18.3.1 or React 19, including patterns to find deprecated APIs, unsafe lifecycle methods, batching issues, and test file problems. Organized by migration path (React 16/17 → 18.3.1 and React 18 → 19) with pre-built scan commands designed for use in automated audit agents.

Generated from the current SKILL.md.

Does this skill cover React 19 migrations?
Yes. The skill includes scan patterns for both React 18.3.1 and React 19 upgrades, with separate reference files for each target version.
Can I use these patterns to audit test files?
Yes. The skill includes dedicated test-specific scan patterns in references/test-scans.md, with separate flags to target or exclude test files as needed.
What grep flags are included?
The skill provides a complete base flag library covering recursive scans, line numbering, filename-only output, file type filtering (JS/JSX), test exclusion patterns, and error suppression.
Does this handle multi-line patterns like async setState?
Yes. The skill explicitly documents that multi-line async setState patterns require specific context flags, and those patterns are included in the reference files.

Generated from the current SKILL.md. These answers refresh after source changes.