Bbackstage

backstage/migrate-mui-switch-to-bui-switch

MUI 4 to BUI: Replace Switch with BUI Switch

backstagemigrationmuibuiswitch
Public
0 executions

Run locally

npx codemod @backstage/migrate-mui-switch-to-bui-switch

@backstage/migrate-mui-switch-to-bui-switch

Migrates MUI 4 Switch usage to Backstage UI Switch.

Covers

  • Named barrel and deep @material-ui/core/Switch imports
  • FormControlLabel wrapping Switch → BUI Switch with label
  • disabledisDisabled, checkedisSelected, defaultCheckeddefaultSelected
  • Merging into an existing @backstage/ui import

TODOs left for humans

  • Non-string FormControlLabel labels
  • Unsupported MUI Switch props (color, size, edge, classes, …)

Won't do

  • Non-Switch FormControlLabel controls (handled by radio/checkbox codemod)

Ready to contribute?

Build your own codemod and share it with the community.