with one click
comments
Repo-wide conventions for code comments. Read this when reviewing or adding code comments.
Menu
Repo-wide conventions for code comments. Read this when reviewing or adding code comments.
| name | comments |
| description | Repo-wide conventions for code comments. Read this when reviewing or adding code comments. |
Comments are a code smell because:
When code isn't clear we should try to make it clearer:
When comments are necessary we should follow these guidelines:
❌ Bad
# pnpm patches add 'patch_hash=HASH' to virtual store paths, which prefab 2.1.0
# (introduced via AGP 8.11) misparses as an option flag due to a clikt bug that splits
# positional path arguments at '='. Pinning prefab to 2.0.0 in gradle.properties avoids
# this; keeping path segments ≤ 80 chars shortens virtual-store paths to reduce the
# likelihood of triggering prefab path-parsing issues as an additional safeguard.
android.prefab.version=2.0.0
virtual-store-dir-max-length=80
✅ Better
# Workaround for Prefab 2.1.0/Clikt bug
# See: https://github.com/google/prefab/issues/187
android.prefab.version=2.0.0
virtual-store-dir-max-length=80
Use test names rather than comments to explain none-obvious details:
❌ Bad
it("diffs the current value against resolved when targeted", () => {
const { result } = renderHook(() => useJsonEditor(makeProps()));
act(() => result.current.setDiffTarget("resolved"));
// Current equals resolved → every line is unchanged.
expect(result.current.diffJson.every(l => l.state === "none")).toBe(true);
});
✅ Good
it("resets the state of every line when the diff is resolved", () => {
const { result } = renderHook(() => useJsonEditor(makeProps()));
act(() => result.current.setDiffTarget("resolved"));
expect(result.current.diffJson.every(l => l.state === "none")).toBe(true);
});
Create a pull request with proper description, changeset, and all required elements
Official Ledger wallet-cli - USB-based CLI for Ledger hardware wallet flows (account discover, receive, balances, operations, send, swap quote/execute/status, genuine-check, assets token / token-by-id). Use for any wallet-cli command execution and for mapping informal requests to the right command.
Guided feature development with codebase understanding and architecture focus
Write unit and integration tests for Ledger Wallet apps. Use for Jest tests (Desktop/Mobile), MSW handlers and testing best practices. Applies to "*.test.*", "*.spec.*", "**/tests/**", "**/__tests__/**", "**/__integrations__/**", "**/jest-setup*"
Coin-specific families logic must live in families/. Generic UI uses the families contract only (no if (family === "evm") in shared code). Use this guidance for work in "**/families/**", "**/mvvm/**", "**/renderer/**" and "**/screens/**".
Prefer Set.has() over Array.includes() for constant allowlists/blocklists. Read this when reviewing or writing membership checks in TypeScript files.