fix(biome): resolve remaining pre-existing lint errors on development#2054
Conversation
- Merge duplicate overrides in biome.json (was silently ignored) - Add scripts/lint/** and .github/scripts/** to useMaxParams override - Add noExplicitAny test-file override to merged overrides array - Fix noArrayIndexKey in feed components (PostCard, CreatePost, PostDetail) - Fix useMaxParams in useWildlifeHistory — consolidate 3 params into opts object - Fix import ordering in (home)/index.tsx and feed/[id].tsx - Add biome-ignore comments in localModelManager.ts and auth/store/user.ts - Auto-format feed screens and hooks 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Coverage Report for Expo Unit Tests Coverage (./apps/expo)
File CoverageNo changed files found. |
Coverage Report for API Unit Tests Coverage (./packages/api)
File CoverageNo changed files found. |
There was a problem hiding this comment.
Pull request overview
Resolves remaining Biome lint failures on the development branch after the Biome 2.4.6 upgrade by correcting config overrides and applying targeted code-level fixes/ignores in Expo and API code.
Changes:
- Fix Biome configuration by merging duplicate
overridesand expandinguseMaxParams/ testnoExplicitAnyexceptions. - Refactor a wildlife history hook to use an options object (reducing parameter count) and update its call site.
- Address/suppress lint findings in feed UI code (array index keys) and legacy
anyusage; apply import/order/format fixes.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/api/src/routes/feed/comments.ts | Import ordering + query formatting for Biome compliance. |
| biome.json | Merge overrides, expand useMaxParams exceptions, add test noExplicitAny override. |
| apps/expo/features/wildlife/screens/IdentificationScreen.tsx | Update addIdentification call to new options-object signature. |
| apps/expo/features/wildlife/hooks/useWildlifeHistory.ts | Refactor addIdentification to accept an opts object to satisfy useMaxParams. |
| apps/expo/features/feed/screens/PostDetailScreen.tsx | Add Biome suppression for array index key usage in image list. |
| apps/expo/features/feed/screens/FeedScreen.tsx | Formatting tweaks (destructuring + refreshControl) to satisfy Biome. |
| apps/expo/features/feed/screens/CreatePostScreen.tsx | Formatting tweaks + Biome suppression for array index key usage in selected photos grid. |
| apps/expo/features/feed/hooks/usePostComments.ts | Axios call formatting for Biome. |
| apps/expo/features/feed/components/PostCard.tsx | Add Biome suppression for array index key usage in image carousel. |
| apps/expo/features/auth/store/user.ts | Add Biome ignore for legacy any cast in persistence plugin wiring. |
| apps/expo/features/ai/lib/localModelManager.ts | Replace eslint disables with Biome ignores for legacy any declarations. |
| apps/expo/app/(app)/feed/[id].tsx | Import ordering cleanup. |
| apps/expo/app/(app)/(tabs)/(home)/index.tsx | Import ordering cleanup. |
Comments suppressed due to low confidence (1)
apps/expo/features/ai/lib/localModelManager.ts:57
getAppleModule()stores the result ofimport('@react-native-ai/apple'), which is a Promise, butisAppleIntelligenceAvailable()treats the return value as a synchronously available module (mod.apple.isAvailable()). This will consistently throw and be caught, making Apple Intelligence appear unavailable even when it should be. Consider switching to a synchronous load (e.g., require-style) or refactoring so the availability check awaits the dynamic import before accessingmod.apple.
// biome-ignore lint/suspicious/noExplicitAny: dynamic import type unknown
let appleModule: any = null;
function getAppleModule() {
if (appleModule) return appleModule;
| {post.images.map((img, idx) => ( | ||
| // biome-ignore lint/suspicious/noArrayIndexKey: images have no stable id | ||
| <Image | ||
| key={`${img}-${idx}`} |
There was a problem hiding this comment.
The key here is already based on img (the image key string), which should be stable; adding idx forces an array-index key and requires a lint suppression. If img is unique per post (as generated by upload), prefer using key={img} and remove both the idx usage and the biome-ignore.
| {post.images.map((img, idx) => ( | |
| // biome-ignore lint/suspicious/noArrayIndexKey: images have no stable id | |
| <Image | |
| key={`${img}-${idx}`} | |
| {post.images.map((img) => ( | |
| <Image | |
| key={img} |
| {post.images.map((img, idx) => ( | ||
| // biome-ignore lint/suspicious/noArrayIndexKey: images have no stable id | ||
| <Image | ||
| key={`${img}-${idx}`} |
There was a problem hiding this comment.
Same as in PostCard: since each img value is an image key string, it can likely serve as a stable React key by itself. Using idx triggers noArrayIndexKey and requires a suppression; prefer key={img} (or another stable identifier) and drop the index + ignore comment if uniqueness is guaranteed.
| {post.images.map((img, idx) => ( | |
| // biome-ignore lint/suspicious/noArrayIndexKey: images have no stable id | |
| <Image | |
| key={`${img}-${idx}`} | |
| {post.images.map((img) => ( | |
| <Image | |
| key={img} |
Summary
Fixes remaining biome lint errors that were pre-existing on
developmentafter the biome 2.4.6 upgrade.overrideskeys inbiome.json(JSON only allows one key — the second was silently overwriting the first, disabling the maxParams override for atom/service files)scripts/lint/**and.github/scripts/**to theuseMaxParamsoverride (these utility scripts legitimately have >2 params)noExplicitAnyoverride to the now-merged overrides arraynoArrayIndexKeyinPostCard,CreatePostScreen,PostDetailScreen(images have no stable id)useMaxParamsinuseWildlifeHistoryhook — consolidate 3 positional params into anoptsobject(home)/index.tsxandfeed/[id].tsxvia biome auto-fixlocalModelManager.tsandauth/store/user.tslegacyanycastsRelationship to #2051
PR #2051 fixed the AI component errors. This PR fixes the remaining errors that biome 2.4.6 surfaces — primarily in feed components (from #1882) and the duplicate-overrides JSON bug.