Skip to content

Commit e3ff7ba

Browse files
rwdaigleclaude
andauthored
Promote forms check to default checks (#39)
The forms check cross-references action formData.get() calls against form input names, catching missing fields deterministically with no false positives. Previously opt-in, now runs by default. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c9660bb commit e3ff7ba

6 files changed

Lines changed: 13 additions & 12 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ npm install -g roto-rooter
1212
rr [OPTIONS] [FILES...]
1313
```
1414

15-
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, hydration) against all files in the current directory.
15+
Point `rr` at your project and it scans your route files for issues. With no arguments it runs the **default checks** (links, forms, loader, params, interactivity, hydration) against all files in the current directory.
1616

1717
| Option | Description |
1818
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -30,7 +30,7 @@ Point `rr` at your project and it scans your route files for issues. With no arg
3030
- **params** (default) -- ensures `useParams()` only accesses params defined in the route path
3131
- **interactivity** (default) -- catches "Save" buttons that don't save, "Delete" buttons that don't delete, and empty click handlers
3232
- **hydration** (default) -- detects SSR/client mismatches from `new Date()`, `Math.random()`, locale-dependent formatting, `window` access in render
33-
- **forms** (opt-in) -- validates `<Form>` targets have actions and that field names match `formData.get()` calls
33+
- **forms** (default) -- validates `<Form>` targets have actions and that field names match `formData.get()` calls
3434
- **drizzle** (opt-in) -- validates Drizzle ORM operations against your schema (missing columns, type mismatches, etc.)
3535

3636
**Example output:**

SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Example output:
3636
rr [FILES...] # analyze files (default: all routes)
3737
rr --check links,forms # run specific checks
3838
rr --check all # run all checks (including optional)
39-
rr --check defaults,forms # run default checks plus specific optional checks
39+
rr --check defaults,drizzle # run default checks plus specific optional checks
4040
rr --format json # JSON output
4141
rr --root ./my-app # set project root
4242
rr sql --drizzle # extract SQL queries from Drizzle ORM code
@@ -48,14 +48,14 @@ rr sql --drizzle --format json # SQL extraction with JSON output
4848
**Default checks** (run automatically):
4949

5050
- **links** - validates `<Link>`, `<NavLink>`, `redirect()`, `navigate()`, and `href` props on any component exist as routes
51+
- **forms** - validates Form action targets, field alignment between forms and actions, intent-based dispatch
5152
- **loader** - detects loader data usage issues and `clientLoader`/`clientAction` with server-only imports
5253
- **params** - validates route params match definitions
5354
- **interactivity** - detects disconnected dialogs ("Save" buttons that don't save, "Delete" buttons that don't delete, stub handlers)
5455
- **hydration** - detects hydration mismatches (Date, Math.random, locale-dependent formatting, window access in render)
5556

5657
**Optional checks** (opt-in via `--check`):
5758

58-
- **forms** - validates Form action targets and method/action mismatches
5959
- **drizzle** - validates database operations against Drizzle ORM schema (unknown tables/columns, missing required columns, null-to-notNull, invalid enum literals, type mismatches, auto-generated column writes, DELETE/UPDATE without WHERE)
6060

6161
## Examples

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "roto-rooter",
3-
"version": "0.8.7",
3+
"version": "0.9.0",
44
"description": "Static analysis and functional verifier tool for React Router applications",
55
"main": "./dist/index.js",
66
"types": "./dist/index.d.ts",

src/analyzer.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@ import {
2424
// Checks that run by default when no --check is specified
2525
export const DEFAULT_CHECKS = [
2626
'links',
27+
'forms',
2728
'loader',
2829
'params',
2930
'interactivity',
3031
'hydration',
3132
];
3233

3334
// Checks that are available but disabled by default (opt-in)
34-
export const OPTIONAL_CHECKS = ['forms', 'drizzle'];
35+
export const OPTIONAL_CHECKS = ['drizzle'];
3536

3637
// All available checks
3738
export const ALL_CHECKS = [...DEFAULT_CHECKS, ...OPTIONAL_CHECKS];

src/cli.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,8 @@ OPTIONS:
404404
-v, --version Show version number
405405
-f, --format <format> Output format: text (default) or json
406406
-c, --check <checks> Comma-separated list of checks to run
407-
Aliases: "defaults" (links, loader, params, interactivity, hydration), "all"
408-
Optional: forms, drizzle
407+
Aliases: "defaults" (links, forms, loader, params, interactivity, hydration), "all"
408+
Optional: drizzle
409409
-r, --root <path> Project root directory containing the app/ folder (default: cwd)
410410
--fix Automatically fix issues where possible
411411
--dry-run Show what would be fixed without modifying files
@@ -421,8 +421,8 @@ EXAMPLES:
421421
# Run only link and form checks
422422
rr --check links,forms
423423
424-
# Run default checks plus forms
425-
rr --check defaults,forms
424+
# Run default checks plus drizzle
425+
rr --check defaults,drizzle
426426
427427
# Run all checks (including optional ones)
428428
rr --check all

0 commit comments

Comments
 (0)