TypeScript tip: Many optional properties are a code smell
TypeScript tip: Many optional properties are a code smell.
Why? Because it reduces type safety.
Example, I joined a project where every REST API call accepts this same argument. This creates confusion, and hurts type safety.
Solution? Specify exactly what each call needs.

Before, it was unclear what properties to set on ApiInfo for this call: 👎
getUserById(apiInfo: ApiInfo)
After, the function's signature clearly says what's required: 👍
getUserById(userId: number)
This change enhances type safety, readability, and improves autocomplete.