-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[typescript] Fix theme.spacing to accept up to 4 arguments #14539
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please format your code and add some test to packages/material-ui/styles/test/index.spec.tsx
@toshi1127 I have taken a shot at the problem, I still need to work on my TypeScript skills :). |
@oliviertassinari |
@@ -1,4 +1,19 @@ | |||
export type Spacing = (value: number | string) => number | string; | |||
/* tslint:disable:unified-signatures */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For future reference: The reason for disabling this rule here is that tslint
suggests using (value1: SpacingArgument, value2?: SpacingArgument)
. This would however accept spacing(1, undefined)
which we do not want to accept.
@toshi1127 and @oliviertassinari Thank you for working on this 😃 |
Closes #14515