chore(lint): enforce single-parameter owned functions#2422
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
packrat-admin | 7f6ccf8 | Commit Preview URL Branch Preview URL |
May 17 2026, 07:00 AM |
|
Important Review skippedToo many files! This PR contains 300 files, which is 150 over the limit of 150. To get a review, narrow the scope: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (300)
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 |
1fed7f0 to
a466c70
Compare
a466c70 to
ed5ed06
Compare
Coverage Report for Expo Unit Tests Coverage (./apps/expo)
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Coverage Report for API Unit Tests Coverage (./packages/api)
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Recovers script lost in force-push reset. Biome stays at max:2 as a general backstop; this script enforces max:1 for owned function definitions while ignoring framework callbacks (renderItem, onChange, etc) that we don't control.
Fixes all 206 no-owned-max-params violations across 50+ files in apps/ and packages/. Every owned function with more than one parameter has been refactored to accept a single destructured options object. All call sites updated to match. Also fixes TypeScript errors introduced by the refactor across test files. Key changes: - packages/units: normalize/fromGrams/displayWeight/convert/parseWeightUnit - packages/analytics: SQLFragments.safeCoalesce/readCsvSource/priceRangeFilter, QueryBuilder methods, LocalCacheManager/CatalogCacheManager search/query APIs, cache-metadata saveMetadata - packages/api: verifyCFAccessRequest, verifyPassword, parseWeight, getEmbeddingText, stitchRouteGeometry, chatContextHelpers - packages/overpass: TrailQueryBuilder.around/bbox (geographic coord methods) - apps/expo: weight utils, convertFromGrams/convertToGrams, ImageCacheManager, imageUtils, chatContextHelpers, weatherService, computePackWeights, getRelativeTime, offline-ai LLM interface - apps/guides: generateContent, enhanceContent, mdx-static, update-authors - scripts/lint: add 'set' to EXTERNAL_CALLBACK_NAMES for Better Auth KV interface lint:custom and check-types both pass (pre-existing errors in admin/auth client/trails/useAuth are unrelated to this change).
…sfy lookback check
Refactors adminFetch and osm.search query key factory from positional to single-object parameter to satisfy no-owned-max-params lint rule.
- adminFetch body: call adminFetcher({input, init}) not positional args
- gear-inventory-screen: update toGrams callers to object-param form
- auth/index: revert verifyPassword call to positional (external @better-auth lib)
- test/setup: align batchVectorSearch mock signature with refactored definition
73512da to
04fe23c
Compare
Resolves 8 conflicts: kept dev-side ETL semantics (atomic totalProcessed counter alongside valid/invalid increments) and AI/chat updates (systemPrompt support in CustomChatTransport, transportKey for useChat remount, getWeatherIconByCondition with isDay, user-id-as-string switch for admin user functions); applied PR's single-param object shape across both new and modified call sites. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Rebased onto current 8 conflict files resolved with dev-semantics + HEAD-shape blending:
Verification:
Companion PR: #2429 ( |
#2428 landed) Conflicts: - apps/expo/features/packs/hooks/usePackOwnershipCheck.ts: HEAD used new single-object obs({store,id}) signature with .peek() (non-reactive); dev rewrote to use$(() => !!obs(packsStore, id).get()) for reactivity. Blended: kept dev's reactive use$ pattern, applied HEAD's single-object obs call form. Post-merge fixes (dev added new files that violated max-params=1): - apps/expo/atoms/atomWithSecureStorage.web.ts: refactor to {key, initialValue} to match native sibling. - apps/expo/features/packs/utils/uploadImage.web.ts: refactor uploadImage/getPresignedUrl/urlToBlob to single-object params; align with native sibling signature. - apps/expo/lib/utils/ImageCacheManager.web.ts: refactor cacheRemoteImage and cacheLocalTempImage to single-object params, matching native ImageCacheManager.ts. - scripts/lint/no-owned-max-params.ts: add /playwright/ to EXCLUDED_PATH_PARTS (parity with /test/ and /__tests__/; playwright fixtures are test code with signatures dictated by Playwright). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Resolves conflicts arising from the recent merge of #2423 (computePackWeights return type changes, schema parsing) and #2377 (auth flow refactor). All resolutions preserve the single-object-param convention enforced by no-owned-max-params; absorbed dev's new return-type wrappers (Zod parse) and the authClient-based password reset flow. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Matches packageManager (bun@1.3.10) but locks the actual version used in CI / CF Pages to 1.3.14 to mirror what's already running in worktrees and mcp-cli-eden. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… MCP rewrite) #2433 restructured packages/mcp/. Took dev's new MCP wholesale; applied no-owned-max-params refactor on top where dev introduced new multi-param owned functions. Refactors applied to satisfy the single-param rule: - mcp client `call(promise, opts)` → `call({ promise, ...opts })` across all 18 tool files (102 sites) - cli `runApi(promise, opts)` → `runApi({ promise, ...opts })` across 24 command files (60 sites) - cli `printTable(rows, opts)` → `printTable({ rows, options })` across 10 sites - cli `printSummary(data, title)` → `printSummary({ data, title })` across 6 sites - mcp `setFeatureFlag(flag, enabled)` → `setFeatureFlag({ flag, enabled })` - mcp `registerFlaggedTool(flag, ...args)` → `registerFlaggedTool({ flag, args })` - mcp `asContent(uri, body)` → `asContent({ uri, body })` in resources.ts - api `rank(key, order)` → `rank({ key, order })` in catalog compare route - api `checkAdminCredentials(username, password)` → object param - api `compute-pack` new `computePackBreakdown` aligned with single-param `normalize`/`parseWeightUnit` Non-MCP conflict resolutions: - apps/landing/components/sections/landing-hero.tsx — kept HEAD (PR's scrollToSection extraction) - apps/landing/components/site-footer.tsx — kept HEAD (same) - packages/api/src/routes/admin/index.ts — took dev's new /login route and queryBoolean usage, then refactored to single-param for timingSafeEqual / verifyCFAccessRequest / assertAllDefined / checkAdminCredentials - packages/api/src/utils/compute-pack.ts — kept HEAD's single-param computePacksWeights; added dev's computePackBreakdown rewritten to use single-param normalize/parseWeightUnit - packages/guards/src/narrow.ts — deduped nullToUndefined/safeIndexOf (both sides added them); kept HEAD's single-param safeIndexOf shape Two build scripts added to the no-owned-max-params allowlist because they override globalThis.fetch and must match the runtime's (input, init) signature: - apps/landing/scripts/generate-og-images.ts - apps/guides/scripts/generate-og-images.ts Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Substantial rebase covering 225 dev commits — #2414 type unification, #2422 single-param refactor, #2433 MCP+CLI Eden Treaty rewrite, #2439 OG meta validation, #2441/#2442 OG URL fix, plus many smaller. Conflicts resolved: - apps/expo/features/packs/utils/uploadImage.ts: kept HEAD's userId cache, used dev's object-arg getPresignedUrl call (matches function signature). - apps/expo/features/trips/hooks/useDeleteTrip.ts: kept HEAD's async + optimistic-delete comment, used dev's object-arg obs() call (matches current obs signature in apps/expo/lib/store.ts). Post-merge cleanup of dev-introduced single-param violations: - apps/expo/lib/utils/__tests__/getRelativeTime.test.ts: rewrote 3 test call sites to object args matching the refactored getRelativeTime. - packages/api/src/utils/__tests__/embeddingHelper.test.ts: rewrote 7 test call sites to object args matching the refactored getEmbeddingText; updated Parameters<> type indexes. - packages/overpass/src/client.test.ts: converted makeResponse to single object param and updated all 11 call sites. - scripts/lint/no-owned-max-params.ts: added apps/trails/scripts/generate-og-images.ts to EXCLUDED_FILES (same globalThis.fetch shim pattern as the existing landing/guides entries). Verification: bun install ok; bun check-types 0 errors; biome check 0 errors (2 unrelated warnings); no-owned-max-params 0 violations. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
scripts/lint/no-owned-max-params.ts— a custom check lost in a force-push resetuseMaxParams: max 2as a general backstop; this script adds the project-specific rule: owned function definitions take at most 1 parameter; inline framework callbacks (renderItem, onChange, etc.) are excluded(subject, opts)/ destructured-object shape — no suppressions, no biome-ignore, no ts-ignoreCommits
chore(lint): restore no-owned-max-params custom check scriptrefactor: convert all owned functions to single object-param signatures(206 violations → 0)fix(casts): move safe-cast annotations inside object literals to satisfy lookback checkPost-Deploy Monitoring & Validation
No additional operational monitoring required: pure lint/style enforcement with no runtime impact.
🤖 Generated with Claude Code