Registry / testing / react-compiler-check

react-compiler-check

JSON →
library0.1.11jsnpmunverified

A CLI tool that scans React projects for code patterns incompatible with React Compiler. Version 0.1.11, pre-1.0 with monthly releases. Detects legacy patterns (string refs, Legacy Context), impure renders (setTimeout, fetch in render), improper hook usage (hooks in loops/conditions), direct state mutations, and dynamic objects. Provides actionable suggestions. Lightweight, zero-config, integrates with ESLint via optional plugin. Unlike React Compiler's built-in checks, this is a standalone diagnostics tool for existing codebases.

npm install react-compiler-check
INSTALL
IMPORT
SIG · REACT-COMPILER-CHE
R
react-compiler-check
testingjavascriptv0.1.11
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default (CLI)
npx react-compiler-check ./src
react-compiler-check
CLI is the primary interface; no JS API exported yet.
require (CJS)
const check = require('react-compiler-check')
Uncommon; the package is designed for CLI use, but can be required programmatically. No default export, use check.run().
ESM import
import { run } from 'react-compiler-check'
import reactCompilerCheck from 'react-compiler-check'
Named export `run` is available for programmatic use. Default export does not exist.

Scans all .js/.jsx/.ts/.tsx files in ./src for React Compiler incompatibilities and displays actionable diagnostics.

npx react-compiler-check ./src
react-compiler-check --version
Debug
Known issues
gotchaTool scans .ts and .tsx files but requires TypeScript installed separately if your project uses TypeScript.
fix
Install typescript as a dev dependency: npm install --save-dev typescript
affects: >=0.0.0
gotchaCLI may not detect issues in files outside the given directory; does not follow imports or resolve monorepos.
fix
Run tool on each package directory separately or use a glob pattern if supported (currently not).
affects: >=0.0.0
gotchaTool reports false positives for patterns that React Compiler actually supports (e.g., certain useEffect dependencies). Always verify with the actual compiler.
fix
Cross-check with React Compiler's own validation. Contribute to the tool to refine rules.
affects: >=0.0.0
breakingBreaking changes in 0.2.0: output format changed from plain text to JSON; API renamed from analyze to run.
fix
Update scripts parsing CLI output or switch to programmatic API with run().
affects: <0.2.0
Errors
Common errors & fixes
Error: Cannot find module 'react-compiler-check'
Package not installed globally or locally, or not in node_modules.
fix
Install locally: npm install react-compiler-check --save-dev. Or use npx: npx react-compiler-check
TypeError: check.run is not a function
Using default import in ESM when only named export exists.
fix
Use import { run } from 'react-compiler-check'
SyntaxError: Unexpected token 'export'
Running in a CJS environment without transpilation.
fix
Use require('react-compiler-check') or configure your bundler to handle ESM.
Upgrade
Version history
0.1.11latest on npm
Audit
Dependencies
typescriptoptionalParses TypeScript files; not required for JavaScript-only projects
Agent activity
4 hits · last 30 days
node
4
Resources
react-compiler-check — npm install react-compiler-check · libregistry