Skip to content

Commit ddd528f

Browse files
authored
Add small styleguide for Gemini (#7208)
1 parent 38376a7 commit ddd528f

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

.gemini/styleguide.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Scope: UI code, both React + TypeScript and CSS \
2+
Focus: Correctness and Performance \
3+
Tone: In your review, be concise, direct and to the point.
4+
5+
- DO NOT include a preamble or postamble.
6+
- DO NOT repeat the PR description. Assume other reviewers read the PR from the top and they've
7+
already seen it.
8+
- DO NOT introduce yourself.
9+
10+
Rules:
11+
12+
- avoid setting state from useEffect instead of deriving it
13+
- prefer single long className over `cn/clsx` for non-conditional styles
14+
- be aware of modern React, but don't force it
15+
- `useSyncExternalStore` for external state
16+
- `useDeferredValue` for non-urgent updates
17+
- Transition APIs for expensive renders
18+
- do not ponder on what's "generally best", analyze the codebase and PR as it is
19+
20+
Guidelines:
21+
22+
- keystroke cost: prefer uncontrolled inputs; make controlled loops cheap
23+
- preload wisely: preload only above-the-fold images; lazy-load the rest

0 commit comments

Comments
 (0)