`initAction` method can be called with unexpected type after migration to Zod
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 413
- Avg merge
- 5d 6h
- Merged PRs (30d)
- 21
Description
When reviewing #6934, I've noticed that the commands like login or connection list are calling initAction method. The method expects that type of the args parameter is CommandArgs defined in Command.ts.
Once we migrated the login command to Zod we are calling the initAction with CommandArgs defined in specific command file.
This works well because both CommandArgs interfaces have the same properties, but over time it can lead to some issues. At least the debug and verbose options for Zod have default value false, the old ones are optional.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the CommandArgs definition and initAction in src/Command.ts with the command-specific definition and call in src/m365/commands/login.ts. Check the migrated command entry points for the same mismatch; done means initAction receives a consistent argument type without relying on matching interfaces or differing Zod defaults, and the TypeScript checks pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100