You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 544cd48
Browse filesBrowse the repository at this point in the historyBrowse files
chore(ci): fail CI when a file gains React effects
We are removing useEffect and its siblings from web and mobile, but nothing
stops new code from adding them back as fast as they come out.
scripts/effect-budget.ts parses every non-test source file under apps/ and
packages/ and counts useEffect, useLayoutEffect, and useInsertionEffect calls,
including React.useEffect-style member calls. scripts/effect-budget.json holds
today's count per file, one sorted entry per line. CI's Lint job and
check:changed fail when a file goes over its entry (a new file has 0). Counts
that drop pass and print a hint; `vp run effect-budget:update` lowers entries
and never raises them, so raising one is a visible manual edit in the PR that
needs the effect.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copy file name to clipboardExpand all lines: AGENTS.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -194,6 +194,7 @@ Architecture and its constraints: `docs/internals/overview.md`. Glossary: `docs/
194
194
options, and pass combinators as additional function-builder arguments.
195
195
- Inferred types over annotations. `any` is the enemy.
196
196
- Default to no comment. Write one only for a constraint, an external quirk, or an invariant the code can't show, in one line where you can and four at most. Don't restate names or signatures, narrate steps, record history, or explain the fix you just made; the PR carries that. `t3code/no-low-value-comments` enforces the length cap and the mechanical cases.
197
+
- React effects are a last resort: derive in render, act in handlers, reset with `key`, or use a ref callback or store. `scripts/effect-budget.json` fails CI when a file gains `useEffect`/`useLayoutEffect`/`useInsertionEffect` calls; raise an entry only in the PR that needs it, with a reason the reviewer can see.
197
198
- Our users drive agents all day and notice a dropped frame, a lying spinner, and a stale label. No continuously repainting animations; they peg the GPU on high-refresh displays.
198
199
- If a rule here fights the task in front of you, say so loudly and get a human sign-off before breaking it.
0 commit comments