Skip to content

fix(biome): resolve remaining pre-existing lint errors on development#2054

Merged
andrew-bierman merged 1 commit into
developmentfrom
fix/biome-scripts-cleanup
Apr 11, 2026
Merged

fix(biome): resolve remaining pre-existing lint errors on development#2054
andrew-bierman merged 1 commit into
developmentfrom
fix/biome-scripts-cleanup

Conversation

@andrew-bierman
Copy link
Copy Markdown
Collaborator

Summary

Fixes remaining biome lint errors that were pre-existing on development after the biome 2.4.6 upgrade.

  • Merge duplicate overrides keys in biome.json (JSON only allows one key — the second was silently overwriting the first, disabling the maxParams override for atom/service files)
  • Add scripts/lint/** and .github/scripts/** to the useMaxParams override (these utility scripts legitimately have >2 params)
  • Add test-file noExplicitAny override to the now-merged overrides array
  • Fix noArrayIndexKey in PostCard, CreatePostScreen, PostDetailScreen (images have no stable id)
  • Fix useMaxParams in useWildlifeHistory hook — consolidate 3 positional params into an opts object
  • Fix import ordering in (home)/index.tsx and feed/[id].tsx via biome auto-fix
  • biome-ignore comments for localModelManager.ts and auth/store/user.ts legacy any casts
  • Auto-format feed screens and hooks

Relationship 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.


Compound Engineered 🤖 Generated with Claude Code

- 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>
Copilot AI review requested due to automatic review settings April 11, 2026 06:34
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 11, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 785a018e-0d74-4e45-ab94-72fd58c43008

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/biome-scripts-cleanup

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

Coverage Report for Expo Unit Tests Coverage (./apps/expo)

Status Category Percentage Covered / Total
🔵 Lines 74.32% 495 / 666
🔵 Statements 74.32% (🎯 75%) 495 / 666
🔵 Functions 90.9% 50 / 55
🔵 Branches 91.34% 190 / 208
File CoverageNo changed files found.
Generated in workflow #78 for commit d48d0f2 by the Vitest Coverage Report Action

@github-actions
Copy link
Copy Markdown
Contributor

Coverage Report for API Unit Tests Coverage (./packages/api)

Status Category Percentage Covered / Total
🔵 Lines 89.66% 902 / 1006
🔵 Statements 89.66% (🎯 80%) 902 / 1006
🔵 Functions 97.95% 48 / 49
🔵 Branches 89.74% 280 / 312
File CoverageNo changed files found.
Generated in workflow #78 for commit d48d0f2 by the Vitest Coverage Report Action

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 overrides and expanding useMaxParams / test noExplicitAny exceptions.
  • 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 any usage; 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 of import('@react-native-ai/apple'), which is a Promise, but isAppleIntelligenceAvailable() 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 accessing mod.apple.
// biome-ignore lint/suspicious/noExplicitAny: dynamic import type unknown
let appleModule: any = null;

function getAppleModule() {
  if (appleModule) return appleModule;

Comment on lines 72 to 75
{post.images.map((img, idx) => (
// biome-ignore lint/suspicious/noArrayIndexKey: images have no stable id
<Image
key={`${img}-${idx}`}
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
{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}

Copilot uses AI. Check for mistakes.
Comment on lines 110 to 113
{post.images.map((img, idx) => (
// biome-ignore lint/suspicious/noArrayIndexKey: images have no stable id
<Image
key={`${img}-${idx}`}
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
{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}

Copilot uses AI. Check for mistakes.
@andrew-bierman andrew-bierman merged commit d48d0f2 into development Apr 11, 2026
9 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants