-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
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
[Grid2] Add removal of item prop to grid-v2-props codemod #43794
Conversation
Netlify deploy previewhttps://deploy-preview-43794--material-ui.netlify.app/ Bundle size report |
@@ -192,6 +192,16 @@ export default function gridV2Props(file, api, options) { | |||
el.node.openingElement.attributes = el.node.openingElement.attributes.filter( | |||
(attr) => !attributesToPrune.includes(attr), | |||
); | |||
|
|||
const itemProp = el.node.openingElement.attributes.find( |
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.
Implementation taken from
material-ui/packages/mui-codemod/src/deprecations/divider-props/divider-props.js
Lines 16 to 29 in 15428ca
const lightProp = elementPath.node.openingElement.attributes.find( | |
(attr) => attr.type === 'JSXAttribute' && attr.name.name === 'light', | |
); | |
if (!lightProp) { | |
return; | |
} | |
elementPath.node.openingElement.attributes = elementPath.node.openingElement.attributes.filter( | |
(attr) => { | |
if (attr.type === 'JSXAttribute' && attr.name.name === 'light') { | |
return false; | |
} | |
return true; |
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.
Nice!
closes #43621