roto-rooter 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -10
- package/dist/analyzer.d.ts +3 -0
- package/dist/analyzer.d.ts.map +1 -1
- package/dist/cli.js +97 -94
- package/dist/index.js +87 -87
- package/dist/types.d.ts +2 -4
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,6 +20,9 @@ rr app/routes/employees.tsx
|
|
|
20
20
|
# Run specific checks only
|
|
21
21
|
rr --check links,forms
|
|
22
22
|
|
|
23
|
+
# Run all checks (including optional ones)
|
|
24
|
+
rr --check all
|
|
25
|
+
|
|
23
26
|
# Output as JSON
|
|
24
27
|
rr --format json
|
|
25
28
|
|
|
@@ -36,18 +39,28 @@ rr --dry-run
|
|
|
36
39
|
rr --fix app/routes/dashboard.tsx
|
|
37
40
|
|
|
38
41
|
# Enable Drizzle ORM persistence checking (auto-discovers schema)
|
|
39
|
-
rr --
|
|
42
|
+
rr --check drizzle
|
|
40
43
|
|
|
41
44
|
# Drizzle checking with explicit schema path
|
|
42
|
-
rr --
|
|
45
|
+
rr --check drizzle --drizzle-schema src/db/schema.ts
|
|
43
46
|
```
|
|
44
47
|
|
|
45
48
|
## Checks
|
|
46
49
|
|
|
50
|
+
**Default checks** (run automatically):
|
|
51
|
+
|
|
47
52
|
- **links**: Validates `<Link>`, `redirect()`, and `navigate()` targets exist as defined routes. Suggests closest matching route when a typo is detected. Auto-fixable when a close match exists.
|
|
48
|
-
- **forms**: Validates `<Form>` components submit to routes with action exports, and that form fields match what the action reads via `formData.get()`. Supports intent-based dispatch patterns. Auto-fixable when targeting a mistyped route.
|
|
49
53
|
- **loader**: Validates `useLoaderData()` is only used in routes that export a loader function.
|
|
50
54
|
- **params**: Validates `useParams()` accesses only params defined in the route path (e.g., `:id` in `/users/:id`).
|
|
55
|
+
- **interactivity**: Detects disconnected interactive elements:
|
|
56
|
+
- Dialog/modal forms where "Save" button only closes the dialog without persisting data
|
|
57
|
+
- "Delete" confirmation buttons that only close without performing the action
|
|
58
|
+
- Buttons with empty or stub onClick handlers (console.log only)
|
|
59
|
+
- Validates dialogs use React Router `<Form>` or `useFetcher.submit()` for data operations
|
|
60
|
+
|
|
61
|
+
**Optional checks** (opt-in via `--check`):
|
|
62
|
+
|
|
63
|
+
- **forms**: Validates `<Form>` components submit to routes with action exports, and that form fields match what the action reads via `formData.get()`. Supports intent-based dispatch patterns. Auto-fixable when targeting a mistyped route.
|
|
51
64
|
- **hydration**: Detects SSR hydration mismatch risks:
|
|
52
65
|
- Date/time operations without consistent timezone handling
|
|
53
66
|
- Locale-dependent formatting (e.g., `toLocaleString()`) without explicit `timeZone` option
|
|
@@ -56,13 +69,7 @@ rr --orm drizzle --drizzle-schema src/db/schema.ts
|
|
|
56
69
|
|
|
57
70
|
Some hydration issues are auto-fixable (e.g., adding `{ timeZone: "UTC" }` to locale methods, replacing `uuid()` with `useId()`).
|
|
58
71
|
|
|
59
|
-
- **
|
|
60
|
-
- Dialog/modal forms where "Save" button only closes the dialog without persisting data
|
|
61
|
-
- "Delete" confirmation buttons that only close without performing the action
|
|
62
|
-
- Buttons with empty or stub onClick handlers (console.log only)
|
|
63
|
-
- Validates dialogs use React Router `<Form>` or `useFetcher.submit()` for data operations
|
|
64
|
-
|
|
65
|
-
- **persistence**: Validates database operations against Drizzle ORM schema. Requires `--orm drizzle` flag. Auto-discovers schema from common locations (`db/schema.ts`, `src/db/schema.ts`, etc.) or use `--drizzle-schema` for custom paths.
|
|
72
|
+
- **drizzle** (persistence): Validates database operations against Drizzle ORM schema. Auto-discovers schema from common locations (`db/schema.ts`, `src/db/schema.ts`, etc.) or use `--drizzle-schema` for custom paths.
|
|
66
73
|
- Missing required columns on `db.insert()` calls
|
|
67
74
|
- Type mismatches (e.g., string from `formData.get()` to integer column)
|
|
68
75
|
- Enum columns receiving unvalidated external input
|
package/dist/analyzer.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { AnalyzerResult, CliOptions } from './types.js';
|
|
2
|
+
export declare const DEFAULT_CHECKS: string[];
|
|
3
|
+
export declare const OPTIONAL_CHECKS: string[];
|
|
4
|
+
export declare const ALL_CHECKS: string[];
|
|
2
5
|
/**
|
|
3
6
|
* Main analyzer - orchestrates parsing and checking
|
|
4
7
|
*/
|
package/dist/analyzer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyzer.d.ts","sourceRoot":"","sources":["../src/analyzer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,cAAc,EAId,UAAU,
|
|
1
|
+
{"version":3,"file":"analyzer.d.ts","sourceRoot":"","sources":["../src/analyzer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,cAAc,EAId,UAAU,EACX,MAAM,YAAY,CAAC;AAgBpB,eAAO,MAAM,cAAc,UAAiD,CAAC;AAG7E,eAAO,MAAM,eAAe,UAAoC,CAAC;AAGjE,eAAO,MAAM,UAAU,UAA0C,CAAC;AAElE;;GAEG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,UAAU,GAAG,cAAc,CA0G3D"}
|