chore(mobile): enable noUncheckedIndexedAccess and noImplicitOverride - #11538
Conversation
apps/mobile extends Expo's tsconfig, not the repo base, so it never had the repo's index-access strictness. That gap let `projects[0] ?? null` type as non-null and hid the null project that crashed every launch of build 56. Turn the two flags on and fix the 87 sites they flag. Most were theme lookups: MobileThemeVariable is now the closed key set that createMobileThemeVariables writes, and the terminal palette is a 16-tuple, so indexed reads stay string without per-site assertions. The rest are regex captures, list fallbacks, and test fixtures. exactOptionalPropertyTypes is left off: it flags ~300 sites, mostly React Native prop objects, and does not bear on this class of bug. Co-Authored-By: Claude Code <noreply@anthropic.com>
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This PR primarily enables stricter TypeScript checks and updates affected indexed accesses, with tests and build-script adjustments alongside it. The reviewed runtime edits preserve existing behavior, including the explicitly named theme fallback matching the prior default. You can add or adjust custom eligibility rules. Learn more. |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (11)
Included review availability: 8 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour. 📝 WalkthroughWalkthroughThe mobile changes tighten TypeScript checks, strengthen theme and palette typing, use ChangesMobile hardening
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Refactor Suggested reviewers: Merge Risk: ⚪ Minimal · up to No actionable behavioral regression was identified in the mobile hardening changes. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 13.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 15 functions across 10 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
Follow-up to #11537.
apps/mobile/tsconfig.jsonextends Expo's base config rather than the repo'stsconfig.base.json, so it never hadnoUncheckedIndexedAccess. That is what letprojectsForEnvironment[0] ?? nulltype as non-null inNewTaskFlowProviderand pass anullproject intoresolveProjectSettingswithout a compile error — the crash on every launch of build 56.This turns on
noUncheckedIndexedAccessandnoImplicitOverridefor mobile and fixes the 87 sites they flag:MobileThemeVariableis now the closed key set thatcreateMobileThemeVariableswrites (verified: identical to the 75 keys ingenerated-uniwind-default-theme-variables.jsonand every--color-*read insrc//modules/), sotheme["--color-x"]isstringand a misspelled key is a compile error rather thanundefinedat runtime.TerminalTheme.paletteis a 16-tuple, matching the 16 ANSI entries both built-in themes define.BUILT_IN_THEMES[0]fallbacks use the exportedT3_CHAT_THEME.exactOptionalPropertyTypesis deliberately left off: it flags ~300 sites, almost all React Native style/prop objects, and does not bear on this class of bug.noImplicitOverridehad zero fallout.Verification
tsc --noEmit -p apps/mobile/tsconfig.json: 87 errors with the flags onmain, 0 here.vp test runon the touched test files (mobileTheme, reviewModel, nativeReviewDiffAdapter, terminalTheme, wideMarkdownBlocks): 46 passing.node scripts/generate-uniwind-themes.mtsproduces byte-identical generated CSS/JSON. No behavior change intended.Claude Fable 5 via Claude Code.
Summary by CodeRabbit
Bug Fixes
Refactor
Tests