-
-
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
[codemod] Add v5.0.0/date-pickers-moved-to-x codemod #31373
[codemod] Add v5.0.0/date-pickers-moved-to-x codemod #31373
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.
Looks good, please add it in the readme of the codemod package before merging.
Thank's for your feedbacks |
@mnajdova done for the README |
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.
Well done
Rename the imports of date and time pickers from `@mui/lab` to `@mui/x-date-pickers` and `@mui/x-date-pickers-pro`. | ||
|
||
```sh | ||
npx @mui/codemod v5.0.0/date-pickers-moved-to-x <path> |
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.
This codemod impacts v5 but not v5.0.0. Maybe it would have made more sense with
npx @mui/codemod v5.0.0/date-pickers-moved-to-x <path> | |
npx @mui/codemod v5.6.0/date-pickers-moved-to-x <path> |
or
npx @mui/codemod v5.0.0/date-pickers-moved-to-x <path> | |
npx @mui/codemod v5/date-pickers-moved-to-x <path> |
Part of mui/mui-x#3451
It is my 1st time playing with codemod so feel free to say if I did something wrong.
@mui/x-date-pickers
if all the imports are available in it, import from@mui/x-date-pickers-pro
otherwiseimport DatePicker from '@mui/lab/DatePicker'
becomesimport { DatePicker } from '@mui/x-date-pickers/DatePicker'
)