Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

This submission improves type safety in src/utils/command-helpers.ts by adding explicit types to three functions (safeChalk, padLeft, and sortOptions), resolving multiple @ts-expect-error comments and making the code more robust. The changes include importing the Option type from commander and adding defensive checks for potentially undefined properties.


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

This commit improves the type safety of `src/utils/command-helpers.ts` by:

-   Adding a `boolean` type to the `noColors` parameter in `safeChalk`.
-   Adding `string` and `number` types to the parameters of `padLeft`.
-   Importing the `Option` type from `commander` to correctly type the `sortOptions` function parameters and adding defensive checks to handle potentially `undefined` properties at runtime.

These changes eliminate three `@ts-expect-error` instances and strengthen the module's type safety and runtime robustness.
@google-labs-jules
Copy link
Contributor Author

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

@github-actions
Copy link

github-actions bot commented Jan 8, 2026

📊 Benchmark results

Comparing with f5b1c11

  • Dependency count: 1,052 (no change)
  • Package size: 317 MB ⬇️ 0.00% decrease vs. f5b1c11
  • Number of ts-expect-error directives: 369 ⬇️ 0.81% decrease vs. f5b1c11

@serhalp serhalp changed the title Improve Type Safety in command-helpers fix(types): improve type safety in command helpers Jan 8, 2026
Copy link
Member

@serhalp serhalp left a comment

Choose a reason for hiding this comment

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

LGTM

@serhalp serhalp marked this pull request as ready for review January 8, 2026 16:23
@serhalp serhalp requested a review from a team as a code owner January 8, 2026 16:23
This commit updates the import of the `Option` type from `commander` to be a type-only import, following a suggestion from the code review. This is a best practice that makes the dependency explicit as a type-only dependency.
@serhalp serhalp enabled auto-merge (squash) January 8, 2026 16:27
@serhalp serhalp self-assigned this Jan 9, 2026
@netlify netlify deleted a comment from mohamedtuodi8-afk Jan 9, 2026
@serhalp serhalp merged commit 665fa01 into main Jan 9, 2026
68 checks passed
@serhalp serhalp deleted the jules/fix-types-in-command-helpers-5578713463807412304 branch January 9, 2026 21:12
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.

3 participants