@mui/codemod 5.13.3 → 5.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +78 -78
  2. package/node/util/propsToObject.js +1 -1
  3. package/node/util/renameClassKey.js +2 -2
  4. package/node/v5.0.0/avatar-circle-circular.js +2 -2
  5. package/node/v5.0.0/badge-overlap-value.js +4 -4
  6. package/node/v5.0.0/circularprogress-variant.js +2 -2
  7. package/node/v5.0.0/fab-variant.js +2 -2
  8. package/node/v5.0.0/joy-rename-row-prop.js +1 -1
  9. package/node/v5.0.0/jss-to-styled.test/eighth.actual.js +8 -6
  10. package/node/v5.0.0/jss-to-styled.test/eighth.expected.js +7 -5
  11. package/node/v5.0.0/jss-to-styled.test/eleventh.actual.js +3 -1
  12. package/node/v5.0.0/jss-to-styled.test/eleventh.expected.js +3 -1
  13. package/node/v5.0.0/jss-to-styled.test/fifth.actual.js +3 -1
  14. package/node/v5.0.0/jss-to-styled.test/fifth.expected.js +3 -1
  15. package/node/v5.0.0/jss-to-styled.test/first.actual.js +4 -2
  16. package/node/v5.0.0/jss-to-styled.test/first.expected.js +4 -2
  17. package/node/v5.0.0/jss-to-styled.test/multipleWithStyles.actual.js +4 -2
  18. package/node/v5.0.0/jss-to-styled.test/multipleWithStyles.expected.js +3 -1
  19. package/node/v5.0.0/jss-to-styled.test/second.actual.js +3 -1
  20. package/node/v5.0.0/jss-to-styled.test/second.expected.js +3 -1
  21. package/node/v5.0.0/jss-to-styled.test/seventh.actual.js +6 -4
  22. package/node/v5.0.0/jss-to-styled.test/seventh.expected.js +6 -4
  23. package/node/v5.0.0/jss-to-styled.test/sixth.actual.js +2 -2
  24. package/node/v5.0.0/jss-to-styled.test/sixth.expected.js +2 -2
  25. package/node/v5.0.0/jss-to-styled.test/tenth.actual.js +3 -1
  26. package/node/v5.0.0/jss-to-styled.test/tenth.expected.js +3 -2
  27. package/node/v5.0.0/jss-to-styled.test/twelfth.actual.js +4 -2
  28. package/node/v5.0.0/link-underline-hover.js +1 -1
  29. package/node/v5.0.0/pagination-round-circular.js +2 -2
  30. package/node/v5.0.0/preset-safe.test/actual.js +9 -7
  31. package/node/v5.0.0/preset-safe.test/expected.js +9 -7
  32. package/node/v5.0.0/skeleton-variant.js +2 -2
  33. package/node/v5.0.0/styled-engine-provider.test/mui-theme-provider.actual.js +3 -1
  34. package/node/v5.0.0/styled-engine-provider.test/mui-theme-provider.expected.js +3 -1
  35. package/node/v5.0.0/styled-engine-provider.test/theme-provider.actual.js +3 -1
  36. package/node/v5.0.0/styled-engine-provider.test/theme-provider.expected.js +3 -1
  37. package/node/v5.0.0/table-props.js +2 -2
  38. package/package.json +4 -4
package/README.md CHANGED
@@ -43,7 +43,7 @@ Examples:
43
43
 
44
44
  To pass more options directly to jscodeshift, use `--jscodeshift="..."`. For example:
45
45
 
46
- ```sh
46
+ ```bash
47
47
  npx @mui/codemod --jscodeshift="--run-in-band --verbose=2"
48
48
  ```
49
49
 
@@ -54,7 +54,7 @@ See all available options [here](https://github.com/facebook/jscodeshift#usage-c
54
54
  Options to [recast](https://github.com/benjamn/recast)'s printer can be provided
55
55
  through jscodeshift's `printOptions` command line argument
56
56
 
57
- ```sh
57
+ ```bash
58
58
  npx @mui/codemod <transform> <path> --jscodeshift="--printOptions='{\"quote\":\"double\"}'"
59
59
  ```
60
60
 
@@ -71,7 +71,7 @@ The `Unstyled` suffix has been removed from all Base UI component names, includi
71
71
  + <Input slots={{ root: 'a' }} href='url' />;
72
72
  ```
73
73
 
74
- ```sh
74
+ ```bash
75
75
  npx @mui/codemod v5.0.0/base-remove-unstyled-suffix <path>
76
76
  ```
77
77
 
@@ -86,7 +86,7 @@ This change only affects Base UI components.
86
86
  + <Input slots={{ root: CustomRoot }} />
87
87
  ```
88
88
 
89
- ```sh
89
+ ```bash
90
90
  npx @mui/codemod v5.0.0/base-remove-component-prop <path>
91
91
  ```
92
92
 
@@ -101,7 +101,7 @@ Updates the names of the CSS variables of the Joy UI components to adapt to the
101
101
  + <Switch sx={{ '--Switch-trackWidth': '40px' }}>
102
102
  ```
103
103
 
104
- ```sh
104
+ ```bash
105
105
  npx @mui/codemod v5.0.0/rename-css-variables <path>
106
106
  ```
107
107
 
@@ -114,7 +114,7 @@ Updates the sources of the imports of the Base UI hooks to adapt to the new dire
114
114
  + import useBadge from '@mui/base/useBadge';
115
115
  ```
116
116
 
117
- ```sh
117
+ ```bash
118
118
  npx @mui/codemod v5.0.0/base-hook-imports <path>
119
119
  ```
120
120
 
@@ -129,7 +129,7 @@ Renames the classname prefix from `'Joy'` to `'Mui'` for Joy UI components.
129
129
  />;
130
130
  ```
131
131
 
132
- ```sh
132
+ ```bash
133
133
  npx @mui/codemod v5.0.0/joy-rename-classname-prefix <path>
134
134
  ```
135
135
 
@@ -144,7 +144,7 @@ Transforms `row` prop to `orientation` prop across `Card`, `List` and `RadioGrou
144
144
  />;
145
145
  ```
146
146
 
147
- ```sh
147
+ ```bash
148
148
  npx @mui/codemod v5.0.0/joy-rename-row-prop <path>
149
149
  ```
150
150
 
@@ -162,7 +162,7 @@ This change only affects Joy UI Avatar component.
162
162
  />;
163
163
  ```
164
164
 
165
- ```sh
165
+ ```bash
166
166
  npx @mui/codemod v5.0.0/joy-avatar-remove-imgProps <path>
167
167
  ```
168
168
 
@@ -220,7 +220,7 @@ This change only affects Joy UI components.
220
220
  +</FormControl>
221
221
  ```
222
222
 
223
- ```sh
223
+ ```bash
224
224
  npx @mui/codemod v5.0.0/joy-text-field-to-input <path>
225
225
  ```
226
226
 
@@ -239,7 +239,7 @@ This change only affects Joy UI components.
239
239
  />;
240
240
  ```
241
241
 
242
- ```sh
242
+ ```bash
243
243
  npx @mui/codemod v5.0.0/joy-rename-components-to-slots <path>
244
244
  ```
245
245
 
@@ -249,7 +249,7 @@ The associated breaking change was done in [#34997](https://github.com/mui/mater
249
249
 
250
250
  Rename the imports of date and time pickers from `@mui/lab` to `@mui/x-date-pickers` and `@mui/x-date-pickers-pro`.
251
251
 
252
- ```sh
252
+ ```bash
253
253
  npx @mui/codemod v5.0.0/date-pickers-moved-to-x <path>
254
254
  ```
255
255
 
@@ -257,7 +257,7 @@ npx @mui/codemod v5.0.0/date-pickers-moved-to-x <path>
257
257
 
258
258
  A combination of all important transformers for migrating v4 to v5. ⚠️ This codemod should be run only once.
259
259
 
260
- ```sh
260
+ ```bash
261
261
  npx @mui/codemod v5.0.0/preset-safe <path|folder>
262
262
  ```
263
263
 
@@ -324,7 +324,7 @@ Imports and inserts `adaptV4Theme` into `createTheme` (or `createMuiTheme`)
324
324
  +createTheme(adaptV4Theme({ palette: { ... }}))
325
325
  ```
326
326
 
327
- ```sh
327
+ ```bash
328
328
  npx @mui/codemod v5.0.0/adapter-v4 <path>
329
329
  ```
330
330
 
@@ -341,7 +341,7 @@ Renames `Autocomplete`'s `closeIcon` prop to `clearIcon`.
341
341
 
342
342
  <!-- #default-branch-switch -->
343
343
 
344
- ```sh
344
+ ```bash
345
345
  npx @mui/codemod v5.0.0/autocomplete-rename-closeicon <path>
346
346
  ```
347
347
 
@@ -360,7 +360,7 @@ Renames `Autocomplete`'s `getOptionSelected` to `isOptionEqualToValue`.
360
360
 
361
361
  <!-- #default-branch-switch -->
362
362
 
363
- ```sh
363
+ ```bash
364
364
  npx @mui/codemod v5.0.0/autocomplete-rename-option <path>
365
365
  ```
366
366
 
@@ -379,7 +379,7 @@ Updates the `Avatar`'s `variant` value and `classes` key from 'circle' to 'circu
379
379
 
380
380
  <!-- #default-branch-switch -->
381
381
 
382
- ```sh
382
+ ```bash
383
383
  npx @mui/codemod v5.0.0/avatar-circle-circular <path>
384
384
  ```
385
385
 
@@ -414,7 +414,7 @@ Renames the badge's props.
414
414
 
415
415
  <!-- #default-branch-switch -->
416
416
 
417
- ```sh
417
+ ```bash
418
418
  npx @mui/codemod v5.0.0/badge-overlap-value <path>
419
419
  ```
420
420
 
@@ -438,7 +438,7 @@ This change only affects Base UI components.
438
438
 
439
439
  <!-- #default-branch-switch -->
440
440
 
441
- ```sh
441
+ ```bash
442
442
  npx @mui/codemod v5.0.0/base-rename-components-to-slots <path>
443
443
  ```
444
444
 
@@ -457,7 +457,7 @@ Updates the Box API from separate system props to `sx`.
457
457
 
458
458
  <!-- #default-branch-switch -->
459
459
 
460
- ```sh
460
+ ```bash
461
461
  npx @mui/codemod v5.0.0/box-borderradius-values <path>
462
462
  ```
463
463
 
@@ -472,7 +472,7 @@ Renames the Box `css` prop to `sx`
472
472
  +<Box sx={{ m: 2 }}>
473
473
  ```
474
474
 
475
- ```sh
475
+ ```bash
476
476
  npx @mui/codemod v5.0.0/box-rename-css <path>
477
477
  ```
478
478
 
@@ -493,7 +493,7 @@ Renames the Box `grid*Gap` props.
493
493
 
494
494
  <!-- #default-branch-switch -->
495
495
 
496
- ```sh
496
+ ```bash
497
497
  npx @mui/codemod v5.0.0/box-rename-gap <path>
498
498
  ```
499
499
 
@@ -510,7 +510,7 @@ Removes the outdated `color` prop values.
510
510
 
511
511
  <!-- #default-branch-switch -->
512
512
 
513
- ```sh
513
+ ```bash
514
514
  npx @mui/codemod v5.0.0/button-color-prop <path>
515
515
  ```
516
516
 
@@ -527,7 +527,7 @@ Removes the Chip `variant` prop if the value is `"default"`.
527
527
 
528
528
  <!-- #default-branch-switch -->
529
529
 
530
- ```sh
530
+ ```bash
531
531
  npx @mui/codemod v5.0.0/chip-variant-prop <path>
532
532
  ```
533
533
 
@@ -544,7 +544,7 @@ Renames the CircularProgress `static` variant to `determinate`.
544
544
 
545
545
  <!-- #default-branch-switch -->
546
546
 
547
- ```sh
547
+ ```bash
548
548
  npx @mui/codemod v5.0.0/circularprogress-variant <path>
549
549
  ```
550
550
 
@@ -563,7 +563,7 @@ Renames `Collapse`'s `collapsedHeight` prop to `collapsedSize`.
563
563
 
564
564
  <!-- #default-branch-switch -->
565
565
 
566
- ```sh
566
+ ```bash
567
567
  npx @mui/codemod v5.0.0/collapse-rename-collapsedheight <path>
568
568
  ```
569
569
 
@@ -582,7 +582,7 @@ A generic codemod to rename any component prop.
582
582
 
583
583
  <!-- #default-branch-switch -->
584
584
 
585
- ```sh
585
+ ```bash
586
586
  npx @mui/codemod v5.0.0/component-rename-prop <path> -- --component=Grid --from=prop --to=newProp
587
587
  ```
588
588
 
@@ -595,7 +595,7 @@ Renames private import from `core/styles/*` to `core/styles`
595
595
  +import { darken, lighten } from '@material-ui/core/styles';
596
596
  ```
597
597
 
598
- ```sh
598
+ ```bash
599
599
  npx @mui/codemod v5.0.0/core-styles-import <path>
600
600
  ```
601
601
 
@@ -608,7 +608,7 @@ Renames the function `createMuiTheme` to `createTheme`
608
608
  +import { createTheme } from '@material-ui/core/styles';
609
609
  ```
610
610
 
611
- ```sh
611
+ ```bash
612
612
  npx @mui/codemod v5.0.0/create-theme <path>
613
613
  ```
614
614
 
@@ -621,7 +621,7 @@ Remove `disableBackdropClick` prop from `<Dialog>`
621
621
  +<Dialog />
622
622
  ```
623
623
 
624
- ```sh
624
+ ```bash
625
625
  npx @mui/codemod v5.0.0/dialog-props <path>
626
626
  ```
627
627
 
@@ -636,7 +636,7 @@ Remove `disableTypography` prop from `<DialogTitle>`
636
636
  +<DialogTitle />
637
637
  ```
638
638
 
639
- ```sh
639
+ ```bash
640
640
  npx @mui/codemod v5.0.0/dialog-title-props <path>
641
641
  ```
642
642
 
@@ -653,7 +653,7 @@ Adds `prepend: true` to Emotion `createCache`
653
653
  });
654
654
  ```
655
655
 
656
- ```sh
656
+ ```bash
657
657
  npx @mui/codemod v5.0.0/create-theme <path>
658
658
  ```
659
659
 
@@ -661,7 +661,7 @@ npx @mui/codemod v5.0.0/create-theme <path>
661
661
 
662
662
  Renames `ExpansionPanel*` to `Accordion*`
663
663
 
664
- ```sh
664
+ ```bash
665
665
  npx @mui/codemod v5.0.0/expansion-panel-component <path>
666
666
  ```
667
667
 
@@ -674,7 +674,7 @@ You can find more details about this breaking change in [the migration guide](ht
674
674
  +<Fab variant="circular" />
675
675
  ```
676
676
 
677
- ```sh
677
+ ```bash
678
678
  npx @mui/codemod v5.0.0/fab-variant <path>
679
679
  ```
680
680
 
@@ -694,7 +694,7 @@ Renames the `fade` style utility import and calls to `alpha`.
694
694
 
695
695
  <!-- #default-branch-switch -->
696
696
 
697
- ```sh
697
+ ```bash
698
698
  npx @mui/codemod v5.0.0/fade-rename-alpha <path>
699
699
  ```
700
700
 
@@ -711,7 +711,7 @@ Renames `Grid`'s `justify` prop to `justifyContent`.
711
711
 
712
712
  <!-- #default-branch-switch -->
713
713
 
714
- ```sh
714
+ ```bash
715
715
  npx @mui/codemod v5.0.0/grid-justify-justifycontent <path>
716
716
  ```
717
717
 
@@ -721,7 +721,7 @@ You can find more details about this breaking change in [the migration guide](ht
721
721
 
722
722
  Renames `GridList*` to `ImageList*`
723
723
 
724
- ```sh
724
+ ```bash
725
725
  npx @mui/codemod v5.0.0/grid-list-component <path>
726
726
  ```
727
727
 
@@ -738,7 +738,7 @@ Adds `size="large"` if `size` is not defined to get the same appearance as v4.
738
738
  +<IconButton size="large" />
739
739
  ```
740
740
 
741
- ```sh
741
+ ```bash
742
742
  npx @mui/codemod v5.0.0/icon-button-size <path>
743
743
  ```
744
744
 
@@ -803,7 +803,7 @@ Replace JSS styling with `makeStyles` or `withStyles` to `styled` API.
803
803
  }
804
804
  ```
805
805
 
806
- ```sh
806
+ ```bash
807
807
  npx @mui/codemod v5.0.0/jss-to-styled <path>
808
808
  ```
809
809
 
@@ -875,7 +875,7 @@ Migrate JSS styling with `makeStyles` or `withStyles` to the corresponding `tss-
875
875
  export default App;
876
876
  ```
877
877
 
878
- ```sh
878
+ ```bash
879
879
  npx @mui/codemod v5.0.0/jss-to-tss-react <path>
880
880
  ```
881
881
 
@@ -903,7 +903,7 @@ Apply `underline="hover"` to `<Link />` that does not define `underline` prop (t
903
903
  +<Link underline="hover" />
904
904
  ```
905
905
 
906
- ```sh
906
+ ```bash
907
907
  npx @mui/codemod v5.0.0/link-underline-hover <path>
908
908
  ```
909
909
 
@@ -941,7 +941,7 @@ Moves JSS imports to `@material-ui/styles`
941
941
  import mergeClasses from '@material-ui/styles/mergeClasses';
942
942
  ```
943
943
 
944
- ```sh
944
+ ```bash
945
945
  npx @mui/codemod v5.0.0/material-ui-styles <path>
946
946
  ```
947
947
 
@@ -954,7 +954,7 @@ Renames `Omit` import from `@material-ui/types` to `DistributiveOmit`
954
954
  +import { DistributiveOmit } from '@material-ui/types';
955
955
  ```
956
956
 
957
- ```sh
957
+ ```bash
958
958
  npx @mui/codemod v5.0.0/material-ui-types <path>
959
959
  ```
960
960
 
@@ -971,7 +971,7 @@ Removes `disableBackdropClick` and `onEscapeKeyDown` from `<Modal>`
971
971
  />
972
972
  ```
973
973
 
974
- ```sh
974
+ ```bash
975
975
  npx @mui/codemod v5.0.0/modal-props <path>
976
976
  ```
977
977
 
@@ -995,7 +995,7 @@ or
995
995
 
996
996
  <!-- #default-branch-switch -->
997
997
 
998
- ```sh
998
+ ```bash
999
999
  npx @mui/codemod v5.0.0/moved-lab-modules <path>
1000
1000
  ```
1001
1001
 
@@ -1020,7 +1020,7 @@ Renames `Pagination*`'s `shape` values from 'round' to 'circular'.
1020
1020
  +<PaginationItem shape="circular" />
1021
1021
  ```
1022
1022
 
1023
- ```sh
1023
+ ```bash
1024
1024
  npx @mui/codemod v5.0.0/pagination-round-circular <path>
1025
1025
  ```
1026
1026
 
@@ -1039,7 +1039,7 @@ Fix private import paths.
1039
1039
 
1040
1040
  <!-- #default-branch-switch -->
1041
1041
 
1042
- ```sh
1042
+ ```bash
1043
1043
  npx @mui/codemod v5.0.0/optimal-imports <path>
1044
1044
  ```
1045
1045
 
@@ -1047,7 +1047,7 @@ npx @mui/codemod v5.0.0/optimal-imports <path>
1047
1047
 
1048
1048
  Removes `RootRef` from the codebase.
1049
1049
 
1050
- ```sh
1050
+ ```bash
1051
1051
  npx @mui/codemod v5.0.0/root-ref <path>
1052
1052
  ```
1053
1053
 
@@ -1062,7 +1062,7 @@ You can find more details about this breaking change in [the migration guide](ht
1062
1062
  +<Skeleton variant="rectangular" />
1063
1063
  ```
1064
1064
 
1065
- ```sh
1065
+ ```bash
1066
1066
  npx @mui/codemod v5.0.0/skeleton-variant <path>
1067
1067
  ```
1068
1068
 
@@ -1072,7 +1072,7 @@ You can find more details about this breaking change in [the migration guide](ht
1072
1072
 
1073
1073
  Applies `StyledEngineProvider` to the files that contains `ThemeProvider`.
1074
1074
 
1075
- ```sh
1075
+ ```bash
1076
1076
  npx @mui/codemod v5.0.0/styled-engine-provider <path>
1077
1077
  ```
1078
1078
 
@@ -1098,7 +1098,7 @@ Renames props in `Table*` components.
1098
1098
 
1099
1099
  ```
1100
1100
 
1101
- ```sh
1101
+ ```bash
1102
1102
  npx @mui/codemod v5.0.0/table-props <path>
1103
1103
  ```
1104
1104
 
@@ -1117,7 +1117,7 @@ Renames the `Tabs`'s `scrollButtons` prop values.
1117
1117
  +<Tabs scrollButtons={false} />
1118
1118
  ```
1119
1119
 
1120
- ```sh
1120
+ ```bash
1121
1121
  npx @mui/codemod v5.0.0/tabs-scroll-buttons <path>
1122
1122
  ```
1123
1123
 
@@ -1136,7 +1136,7 @@ Renames `TextField`'s rows props.
1136
1136
  +<TextareaAutosize minRows={3} maxRows={6} />
1137
1137
  ```
1138
1138
 
1139
- ```sh
1139
+ ```bash
1140
1140
  npx @mui/codemod v5.0.0/textarea-minmax-rows <path>
1141
1141
  ```
1142
1142
 
@@ -1149,7 +1149,7 @@ You can find more details about this breaking change in the migration guide.
1149
1149
 
1150
1150
  Adds `DefaultTheme` module augmentation to typescript projects.
1151
1151
 
1152
- ```sh
1152
+ ```bash
1153
1153
  npx @mui/codemod v5.0.0/theme-augment <path>
1154
1154
  ```
1155
1155
 
@@ -1168,7 +1168,7 @@ Updates breakpoint values to match new logic. ⚠️ This mod is not idempotent,
1168
1168
 
1169
1169
  <!-- #default-branch-switch -->
1170
1170
 
1171
- ```sh
1171
+ ```bash
1172
1172
  npx @mui/codemod v5.0.0/theme-breakpoints <path>
1173
1173
  ```
1174
1174
 
@@ -1178,7 +1178,7 @@ You can find more details about this breaking change in [the migration guide](ht
1178
1178
 
1179
1179
  Renames `theme.breakpoints.width('md')` to `theme.breakpoints.values.md`.
1180
1180
 
1181
- ```sh
1181
+ ```bash
1182
1182
  npx @mui/codemod v5.0.0/theme-breakpoints-width <path>
1183
1183
  ```
1184
1184
 
@@ -1191,7 +1191,7 @@ You can find more details about this breaking change in [the migration guide](ht
1191
1191
  +import { DeprecatedThemeOptions } from '@material-ui/core';
1192
1192
  ```
1193
1193
 
1194
- ```sh
1194
+ ```bash
1195
1195
  npx @mui/codemod v5.0.0/theme-options <path>
1196
1196
  ```
1197
1197
 
@@ -1213,7 +1213,7 @@ Renames `type` to `mode`.
1213
1213
  +theme.palette.mode === 'dark'
1214
1214
  ```
1215
1215
 
1216
- ```sh
1216
+ ```bash
1217
1217
  npx @mui/codemod v5.0.0/theme-palette-mode <path>
1218
1218
  ```
1219
1219
 
@@ -1223,7 +1223,7 @@ You can find more details about this breaking change in [the migration guide](ht
1223
1223
 
1224
1224
  Renames `MuiThemeProvider` to `ThemeProvider`.
1225
1225
 
1226
- ```sh
1226
+ ```bash
1227
1227
  npx @mui/codemod v5.0.0/theme-provider <path>
1228
1228
  ```
1229
1229
 
@@ -1242,7 +1242,7 @@ Removes the 'px' suffix from some template strings.
1242
1242
 
1243
1243
  <!-- #default-branch-switch -->
1244
1244
 
1245
- ```sh
1245
+ ```bash
1246
1246
  npx @mui/codemod v5.0.0/theme-spacing <path>
1247
1247
  ```
1248
1248
 
@@ -1257,7 +1257,7 @@ Renames `theme.typography.round($number)` to `Math.round($number * 1e5) / 1e5`.
1257
1257
  +`${Math.round($number * 1e5) / 1e5}`
1258
1258
  ```
1259
1259
 
1260
- ```sh
1260
+ ```bash
1261
1261
  npx @mui/codemod v5.0.0/theme-typography-round <path>
1262
1262
  ```
1263
1263
 
@@ -1275,7 +1275,7 @@ Converts all `@mui/material` submodule imports to the root module:
1275
1275
 
1276
1276
  <!-- #default-branch-switch -->
1277
1277
 
1278
- ```sh
1278
+ ```bash
1279
1279
  npx @mui/codemod v5.0.0/top-level-imports <path>
1280
1280
  ```
1281
1281
 
@@ -1285,7 +1285,7 @@ Head to https://mui.com/guides/minimizing-bundle-size/ to understand when it's u
1285
1285
 
1286
1286
  Renames import `transitions` to `createTransitions`
1287
1287
 
1288
- ```sh
1288
+ ```bash
1289
1289
  npx @mui/codemod v5.0.0/transitions <path>
1290
1290
  ```
1291
1291
 
@@ -1298,7 +1298,7 @@ Renames `useAutocomplete` related import from lab to core
1298
1298
  +import useAutocomplete from '@material-ui/core/useAutocomplete';
1299
1299
  ```
1300
1300
 
1301
- ```sh
1301
+ ```bash
1302
1302
  npx @mui/codemod v5.0.0/use-autocomplete <path>
1303
1303
  ```
1304
1304
 
@@ -1327,7 +1327,7 @@ Updates Dialog, Menu, Popover, and Snackbar to use the `TransitionProps` prop to
1327
1327
 
1328
1328
  <!-- #default-branch-switch -->
1329
1329
 
1330
- ```sh
1330
+ ```bash
1331
1331
  npx @mui/codemod v5.0.0/use-transitionprops <path>
1332
1332
  ```
1333
1333
 
@@ -1357,7 +1357,7 @@ The diff should look like this:
1357
1357
 
1358
1358
  <!-- #default-branch-switch -->
1359
1359
 
1360
- ```sh
1360
+ ```bash
1361
1361
  npx @mui/codemod v5.0.0/variant-prop <path>
1362
1362
  ```
1363
1363
 
@@ -1371,7 +1371,7 @@ Removes imported `withMobileDialog`, and inserts hardcoded version to prevent ap
1371
1371
  +const withMobileDialog = () => (WrappedComponent) => (props) => <WrappedComponent {...props} width="lg" fullScreen={false} />;
1372
1372
  ```
1373
1373
 
1374
- ```sh
1374
+ ```bash
1375
1375
  npx @mui/codemod v5.0.0/with-mobile-dialog <path>
1376
1376
  ```
1377
1377
 
@@ -1387,7 +1387,7 @@ Removes `withWidth` import, and inserts hardcoded version to prevent application
1387
1387
  +const withWidth = () => (WrappedComponent) => (props) => <WrappedComponent {...props} width="xs" />;
1388
1388
  ```
1389
1389
 
1390
- ```sh
1390
+ ```bash
1391
1391
  npx @mui/codemod v5.0.0/with-width <path>
1392
1392
  ```
1393
1393
 
@@ -1448,7 +1448,7 @@ Replace every occurrence of `material-ui` related package with the new package n
1448
1448
  +"@mui/styled-engine-sc": "next",
1449
1449
  ```
1450
1450
 
1451
- ```sh
1451
+ ```bash
1452
1452
  npx @mui/codemod v5.0.0/mui-replace <path>
1453
1453
  ```
1454
1454
 
@@ -1468,7 +1468,7 @@ The diff should look like this:
1468
1468
 
1469
1469
  <!-- #default-branch-switch -->
1470
1470
 
1471
- ```sh
1471
+ ```bash
1472
1472
  npx @mui/codemod v4.0.0/theme-spacing-api <path>
1473
1473
  ```
1474
1474
 
@@ -1495,7 +1495,7 @@ Converts all `@material-ui/core` imports more than 1 level deep to the optimal f
1495
1495
 
1496
1496
  <!-- #default-branch-switch -->
1497
1497
 
1498
- ```sh
1498
+ ```bash
1499
1499
  npx @mui/codemod v4.0.0/optimal-imports <path>
1500
1500
  ```
1501
1501
 
@@ -1513,7 +1513,7 @@ Converts all `@material-ui/core` submodule imports to the root module:
1513
1513
 
1514
1514
  <!-- #default-branch-switch -->
1515
1515
 
1516
- ```sh
1516
+ ```bash
1517
1517
  npx @mui/codemod v4.0.0/top-level-imports <path>
1518
1518
  ```
1519
1519
 
@@ -1534,7 +1534,7 @@ The diff should look like this:
1534
1534
 
1535
1535
  <!-- #default-branch-switch -->
1536
1536
 
1537
- ```sh
1537
+ ```bash
1538
1538
  npx @mui/codemod v1.0.0/import-path <path>
1539
1539
  ```
1540
1540
 
@@ -1561,7 +1561,7 @@ The diff should look like this:
1561
1561
 
1562
1562
  <!-- #default-branch-switch -->
1563
1563
 
1564
- ```sh
1564
+ ```bash
1565
1565
  npx @mui/codemod v1.0.0/color-imports <path>
1566
1566
  ```
1567
1567
 
@@ -1569,7 +1569,7 @@ npx @mui/codemod v1.0.0/color-imports <path>
1569
1569
 
1570
1570
  <!-- #default-branch-switch -->
1571
1571
 
1572
- ```sh
1572
+ ```bash
1573
1573
  npx @mui/codemod v1.0.0/color-imports <path> -- --importPath='mui/styles/colors' --targetPath='mui/colors'
1574
1574
  ```
1575
1575
 
@@ -1587,7 +1587,7 @@ The diff should look like this:
1587
1587
 
1588
1588
  <!-- #default-branch-switch -->
1589
1589
 
1590
- ```sh
1590
+ ```bash
1591
1591
  npx @mui/codemod v1.0.0/svg-icon-imports <path>
1592
1592
  ```
1593
1593
 
@@ -1605,7 +1605,7 @@ The diff should look like this:
1605
1605
 
1606
1606
  <!-- #default-branch-switch -->
1607
1607
 
1608
- ```sh
1608
+ ```bash
1609
1609
  npx @mui/codemod v1.0.0/menu-item-primary-text <path>
1610
1610
  ```
1611
1611
 
@@ -1629,6 +1629,6 @@ The diff should look like this:
1629
1629
 
1630
1630
  <!-- #default-branch-switch -->
1631
1631
 
1632
- ```sh
1632
+ ```bash
1633
1633
  npx @mui/codemod v0.15.0/import-path <path>
1634
1634
  ```
@@ -42,7 +42,7 @@ function propsToObject({
42
42
  if (propValue.length > 0) {
43
43
  const propNameAttr = attributes.find(attr => {
44
44
  var _attr$name;
45
- return (attr == null ? void 0 : (_attr$name = attr.name) == null ? void 0 : _attr$name.name) === propName;
45
+ return (attr == null || (_attr$name = attr.name) == null ? void 0 : _attr$name.name) === propName;
46
46
  });
47
47
  if (propNameAttr) {
48
48
  var _propNameAttr$value$e;
@@ -13,8 +13,8 @@ function renameClassKey({
13
13
  const source = root.findJSXElements(componentName).forEach(path => {
14
14
  path.node.openingElement.attributes.forEach(node => {
15
15
  if (node.type === 'JSXAttribute' && node.name.name === 'classes') {
16
- var _node$value, _node$value$expressio, _node$value$expressio2;
17
- (_node$value = node.value) == null ? void 0 : (_node$value$expressio = _node$value.expression) == null ? void 0 : (_node$value$expressio2 = _node$value$expressio.properties) == null ? void 0 : _node$value$expressio2.forEach(subNode => {
16
+ var _node$value;
17
+ (_node$value = node.value) == null || (_node$value = _node$value.expression) == null || (_node$value = _node$value.properties) == null ? void 0 : _node$value.forEach(subNode => {
18
18
  if (Object.keys(classes).includes(subNode.key.name)) {
19
19
  subNode.key.name = classes[subNode.key.name];
20
20
  }
@@ -18,8 +18,8 @@ function transformer(file, api, options) {
18
18
  node.value = j.literal('circular');
19
19
  }
20
20
  if (node.type === 'JSXAttribute' && node.name.name === 'classes') {
21
- var _node$value, _node$value$expressio2, _node$value$expressio3;
22
- (_node$value = node.value) == null ? void 0 : (_node$value$expressio2 = _node$value.expression) == null ? void 0 : (_node$value$expressio3 = _node$value$expressio2.properties) == null ? void 0 : _node$value$expressio3.forEach(subNode => {
21
+ var _node$value;
22
+ (_node$value = node.value) == null || (_node$value = _node$value.expression) == null || (_node$value = _node$value.properties) == null ? void 0 : _node$value.forEach(subNode => {
23
23
  if (subNode.key.name === 'circle') {
24
24
  subNode.key.name = 'circular';
25
25
  }