Static analysis and functional verifier tool for React Router applications
npm install roto-rooterA static analysis tool for React Router apps. It catches common bugs -- broken links, missing loaders, hydration mismatches, disconnected UI elements, and incorrect database operations -- by reading your route definitions and cross-referencing them against your components.
```
npm install -g roto-rooter
``
rr [OPTIONS] [FILES...]
Point rr at your project and it scans your route files for issues. With no arguments it runs the default checks (links, loader, params, interactivity) against all files in the current directory.
| Option | Description |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| -c, --check | Comma-separated checks to run. Use defaults for the default set, all for everything, or pick individual checks: links, loader, params, interactivity, forms, hydration, drizzle |-f, --format
| | Output format: text (default) or json |-r, --root
| | Project root containing the app/ folder (default: cwd) |--fix
| | Auto-fix issues where possible |--dry-run
| | Preview fixes without writing files |--drizzle-schema
| | Path to Drizzle schema file (auto-discovered by default) |
Checks at a glance:
- links (default) -- validates , redirect(), navigate(), and href props on any component exist as routesuseLoaderData()
- loader (default) -- ensures is backed by a loader; catches clientLoader importing server-only modulesuseParams()
- params (default) -- ensures only accesses params defined in the route path
- interactivity (default) -- catches "Save" buttons that don't save, "Delete" buttons that don't delete, and empty click handlers
- forms (opt-in) -- validates