Skip to content
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

list-item-button-prop codemod adds ListItemButton import to all files #43527

Closed
Studio384 opened this issue Aug 30, 2024 · 3 comments · Fixed by #43532
Closed

list-item-button-prop codemod adds ListItemButton import to all files #43527

Studio384 opened this issue Aug 30, 2024 · 3 comments · Fixed by #43532
Assignees
Labels
bug 🐛 Something doesn't work component: list This is the name of the generic UI component, not the React module! package: codemod Specific to @mui/codemod

Comments

@Studio384
Copy link
Contributor

Studio384 commented Aug 30, 2024

Steps to reproduce

Link to live example: (required)

Steps:

  1. Use the list-item-button-prop

Current behavior

The mod will add imports for ListItemButton to all files, regardless of whether or not they use ListItem button or even if ListItemButton is already present when directly imported from @mui/material.

Expected behavior

The codemod doesn't import a component in every file where it isn't being used and doesn't import the component in a file that already has an import for it.

Context

As part of the migration to MUI v6 I wanted to run this codemod. It just gave me extra work to filter out the changes it made from the changes made in previous steps...

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: codemod listitem listitembutton list-item-button-props

@Studio384 Studio384 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Aug 30, 2024
@siriwatknp siriwatknp added bug 🐛 Something doesn't work package: codemod Specific to @mui/codemod component: list This is the name of the generic UI component, not the React module! and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Aug 30, 2024
@siriwatknp
Copy link
Member

I'd consider this a bug because it's an unexpected behavior

@siriwatknp siriwatknp self-assigned this Aug 30, 2024
@ddolcimascolo
Copy link

Confirmed. IMHO This makes the codemod unusable

Copy link

github-actions bot commented Sep 2, 2024

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Note

We value your feedback @Studio384! How was your experience with our support team?
If you could spare a moment, we'd love to hear your thoughts in this brief Support Satisfaction survey. Your insights help us improve!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: list This is the name of the generic UI component, not the React module! package: codemod Specific to @mui/codemod
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants