Skip to content

🧹 Refactor CLI options to use explicit type instead of 'any' - #9

Merged
sebamar88 merged 1 commit into
mainfrom
refactor-cli-options-type-safety-4561401687491474312
Mar 18, 2026
Merged

🧹 Refactor CLI options to use explicit type instead of 'any'#9
sebamar88 merged 1 commit into
mainfrom
refactor-cli-options-type-safety-4561401687491474312

Conversation

@sebamar88

Copy link
Copy Markdown
Owner

This change improves the code health of the CLI module by replacing the explicit 'any' type for the options parameter in several functions with a well-defined CliOptions interface.

Key improvements:

  • Defined a CliOptions interface that captures the shape of CLI arguments (url, method, body, headers, etc.).
  • Replaced the any keyword in handleSimpleFetch and handleTypeGeneration with CliOptions & { url: string }, ensuring that the URL is present when these handlers are called.
  • Replaced the inline type definition in runCli with the new CliOptions interface, reducing duplication.
  • Improved readability and maintainability of the CLI entry point by providing better type information for developers.

Verification:

  • Manually reviewed the changes to ensure correctness.
  • Code review confirmed the quality and safety of the refactoring.
  • Attempted to run typecheck and tests, though environment limitations prevented full execution in the sandbox. The changes are strictly type-level and do not affect runtime behavior.

PR created automatically by Jules for task 4561401687491474312 started by @sebamar88

Defined a CliOptions interface in src/cli/index.ts to improve type safety
and maintainability. Replaced the use of 'any' in handleSimpleFetch and
handleTypeGeneration with the new interface. Updated runCli to use
CliOptions for its local options object.

Co-authored-by: sebamar88 <4359231+sebamar88@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
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.

@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@sonarqubecloud

Copy link
Copy Markdown

@sebamar88
sebamar88 merged commit adca31a into main Mar 18, 2026
7 of 17 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.

1 participant