MetaMask / MetaMask/metamask-design-system
Refactor: Replace MakePropsOptional with TypeScript Partial utility type
- Dominant language
- TypeScript
- Stars
- 37
- Forks
- 14
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 60
Description
### **Description**
Replace all instances of the custom `MakePropsOptional` utility type with TypeScript's built-in `Partial` utility type in the @design-system-react package. This will reduce code duplication and leverage TypeScript's standard library.
### **Technical Details**
- Remove the custom utility type file: `src/types/make-props-optional.ts`
- Update all imports to use TypeScript's `Partial` type
- Current identified usage in:
- `ButtonBase.types.ts`:
```typescript
startIconProps?: MakePropsOptional;
endIconProps?: MakePropsOptional;
loadingIconProps?: MakePropsOptional;
```
### **Acceptance Criteria**
- [ ] Remove `make-props-optional.ts` file
- [ ] Replace all instances of `MakePropsOptional` with `Partial`
- [ ] Remove any imports referencing `MakePropsOptional`
- [ ] Ensure all tests pass
- [ ] Update any relevant documentation
- [ ] No changes in functionality or type checking behavior
### **References**
- TypeScript `Partial` documentation: https://www.typescriptlang.org/docs/handbook/utility-types.html#partialtype
- Current implementation file: `packages/design-system-react/src/types/make-props-optional.ts`
Contributor guide
Assessment
This issue has not been assessed yet.