Skip to content

Improve type safety in leaf node utility modules#7928

Draft
serhalp wants to merge 5 commits intomainfrom
improve-type-safety-leaf-nodes-dot-env-upload-files-11772470502921649798
Draft

Improve type safety in leaf node utility modules#7928
serhalp wants to merge 5 commits intomainfrom
improve-type-safety-leaf-nodes-dot-env-upload-files-11772470502921649798

Conversation

@serhalp
Copy link
Member

@serhalp serhalp commented Feb 4, 2026

Improved type safety in src/utils/dot-env.ts and src/utils/deploy/upload-files.ts by removing @ts-expect-errors, adding interfaces, and using type guards. Verified with type checking and unit tests.


PR created automatically by Jules for task 11772470502921649798 started by @serhalp

This commit improves type safety in `src/utils/dot-env.ts` and `src/utils/deploy/upload-files.ts` by:
- Defining clear interfaces for data structures (`DotEnvFile`, `UploadFileObj`, etc.).
- Adding explicit types to function parameters and return values.
- Implementing robust type guards (e.g., `isErrorWithStatus`) for safe error handling.
- Removing numerous `@ts-expect-error` and implicit `any` types.
- Updating corresponding unit tests to match stricter types.
- Resolving downstream type errors in `src/utils/dev.ts`.

These changes follow modern TypeScript best practices and improve maintainability by documenting the contract between utility functions and their consumers.

Co-authored-by: serhalp <1377702+serhalp@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@serhalp serhalp requested a review from a team as a code owner February 4, 2026 16:23
@github-actions
Copy link

github-actions bot commented Feb 4, 2026

📊 Benchmark results

Comparing with 63b6f1c

  • Dependency count: 1,081 (no change)
  • Package size: 324 MB ⬆️ 0.00% increase vs. 63b6f1c
  • Number of ts-expect-error directives: 346 ⬇️ 5.49% decrease vs. 63b6f1c

google-labs-jules bot and others added 4 commits February 4, 2026 16:27
This commit improves type safety in `src/utils/dot-env.ts` and `src/utils/deploy/upload-files.ts` by:
- Defining clear interfaces for data structures (`DotEnvFile`, `UploadFileObj`, etc.).
- Adding explicit types to function parameters and return values.
- Implementing robust type guards (e.g., `isErrorWithStatus`) for safe error handling.
- Removing numerous `@ts-expect-error` and implicit `any` types.
- Updating corresponding unit tests to match stricter types.
- Resolving downstream type errors in `src/utils/dev.ts`.

These changes follow modern TypeScript best practices and improve maintainability by documenting the contract between utility functions and their consumers.

Co-authored-by: serhalp <1377702+serhalp@users.noreply.github.com>
This commit improves type safety in `src/utils/dot-env.ts` and `src/utils/deploy/upload-files.ts` by:
- Defining clear interfaces for data structures (`DotEnvFile`, `UploadFileObj`, etc.).
- Adding explicit types to function parameters and return values.
- Implementing robust type guards (e.g., `isErrorWithStatus`) for safe error handling.
- Removing numerous `@ts-expect-error` and implicit `any` types.
- Updating corresponding unit tests to match stricter types.
- Resolving downstream type errors in `src/utils/dev.ts`.
- Fixing ESLint errors (no-explicit-any, no-unnecessary-condition).

These changes follow modern TypeScript best practices and improve maintainability by documenting the contract between utility functions and their consumers.

Co-authored-by: serhalp <1377702+serhalp@users.noreply.github.com>
This commit improves type safety in `src/utils/dot-env.ts` and `src/utils/deploy/upload-files.ts` by:
- Defining clear interfaces for data structures (`DotEnvFile`, `UploadFileObj`, etc.).
- Adding explicit types to function parameters and return values.
- Implementing robust type guards (e.g., `isErrorWithStatus`) for safe error handling.
- Removing numerous `@ts-expect-error` and implicit `any` types.
- Updating corresponding unit tests to match stricter types.
- Resolving downstream type errors in `src/utils/dev.ts`.
- Fixing ESLint and formatting issues.

These changes follow modern TypeScript best practices and improve maintainability by documenting the contract between utility functions and their consumers.

Co-authored-by: serhalp <1377702+serhalp@users.noreply.github.com>
This commit improves type safety in `src/utils/dot-env.ts` and `src/utils/deploy/upload-files.ts` by:
- Defining clear interfaces for data structures (`DotEnvFile`, `UploadFileObj`, etc.).
- Adding explicit types to function parameters and return values.
- Implementing robust type guards (e.g., `isErrorWithStatus`) for safe error handling.
- Removing numerous `@ts-expect-error` and implicit `any` types.
- Updating corresponding unit tests to match stricter types.
- Resolving downstream type errors in `src/utils/dev.ts`.
- Fixing ESLint and formatting issues.

These changes follow modern TypeScript best practices and improve maintainability by documenting the contract between utility functions and their consumers.

Co-authored-by: serhalp <1377702+serhalp@users.noreply.github.com>
@serhalp serhalp marked this pull request as draft February 4, 2026 17:25
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.

1 participant