Skip to content

fix(#578): remove any casts from lib/blockchain modules#628

Merged
llinsss merged 3 commits into
DogStark:mainfrom
Xaxxoo:fix/578-remove-any-casts-blockchain
Jun 26, 2026
Merged

fix(#578): remove any casts from lib/blockchain modules#628
llinsss merged 3 commits into
DogStark:mainfrom
Xaxxoo:fix/578-remove-any-casts-blockchain

Conversation

@Xaxxoo

@Xaxxoo Xaxxoo commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Resolves #578 — removes all any casts from the two blockchain integration files.

Changes

src/lib/blockchain/index.ts

  • Removed declare const process: any and its comment. @types/node is already listed as a devDependency and "types": ["node"] is set in tsconfig.json, so the Node.js process global is already properly typed without a manual declaration.

src/lib/blockchain/stellarSync.ts

  • MedicalRecord was referenced in method signatures and exported but was never imported or defined, causing a TS2304: Cannot find name 'MedicalRecord' error. Added a proper import type { MedicalRecord } from './types' import.
  • Split the combined import { stellarService, StellarService, TransactionResult } into a value import (stellarService) and import type imports (StellarService, TransactionResult) to comply with @typescript-eslint/consistent-type-imports and isolatedModules.
  • Changed export { MedicalRecord }export type { MedicalRecord } as required by isolatedModules.

src/lib/blockchain/types.ts

  • Added the MedicalRecord interface (shaped from its usage in stellarSync.ts): id, petId, type, critical, data.

package.json / package-lock.json

  • Fixed prettier devDependency from ^3.9.0 (no such release exists; latest stable is 3.8.4) to ^3.8.0 so that npm ci succeeds in CI. Without this fix the Install dependencies step fails on every CI run.

Acceptance Criteria

  • No any remains in src/lib/blockchain/index.ts
  • No any remains in src/lib/blockchain/stellarSync.ts
  • Type-check passes after removing the manual process declaration (tsc --noEmit reports zero errors for all blockchain/hooks files)
  • ESLint reports zero errors on all changed files

Test plan

  • npm ci completes without errors (prettier version fix)
  • npx tsc --noEmit produces no errors in src/lib/blockchain/ or src/hooks/useBlockchainSync.ts
  • eslint src/lib/blockchain/ produces no errors
  • Next.js build (npx next build) succeeds

🤖 Generated with Claude Code

- Remove `declare const process: any` from index.ts; @types/node (already
  a devDependency with "types": ["node"] in tsconfig) provides proper
  typings for the Node.js process global
- Add MedicalRecord interface to types.ts and import it explicitly in
  stellarSync.ts, replacing the previously unresolved global reference
- Use `import type` for type-only imports and `export type` for the
  MedicalRecord re-export to satisfy isolatedModules
- Fix prettier devDependency version from ^3.9.0 (non-existent) to
  ^3.8.0 so that `npm ci` succeeds in CI

Closes DogStark#578

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@drips-wave

drips-wave Bot commented Jun 24, 2026

Copy link
Copy Markdown

@Xaxxoo Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

llinsss added 2 commits June 26, 2026 11:30
Resolves the package-lock.json modify/delete conflict the same way as
DogStark#650: regenerated the lockfile with npm install rather than keeping it
deleted (npm ci requires a lockfile to exist, and main's own lockfile
is independently out of sync regardless).

Also resolves a real content conflict in package.json's devDependencies.
While doing so, deduplicated a pre-existing mess already on main: roughly
half of devDependencies were listed twice with conflicting versions
(e.g. two 'prettier', two 'ts-jest', two '@types/jest' entries) -- valid
JSON since duplicate keys silently take the last value, but clearly the
result of an earlier improperly-resolved merge. Kept each key once,
using whichever version was already the effective (last-listed, i.e.
actually-installed) one on main.
@llinsss
llinsss merged commit 2b38fc0 into DogStark:main Jun 26, 2026
7 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Frontend] Remove any Casts from lib/blockchain Modules

2 participants