Skip to content

[codemod] Fix experimentalFeatures codemod for typescript parser#14150

Merged
MBilalShafi merged 6 commits intomui:masterfrom
MBilalShafi:codemod/typescript-support-for-removeObjectProperty
Sep 3, 2024
Merged

[codemod] Fix experimentalFeatures codemod for typescript parser#14150
MBilalShafi merged 6 commits intomui:masterfrom
MBilalShafi:codemod/typescript-support-for-removeObjectProperty

Conversation

@MBilalShafi
Copy link
Copy Markdown
Member

@MBilalShafi MBilalShafi commented Aug 9, 2024

Fix #12874

Weirdly so, the tsx parser vs js parser sometimes behaves differently. It was the case with the removeObjectProperty utility being used in the experimentalFeatures codemod.

This can be visualized here. Try commenting the line 3 of the codemod script export const parser = "tsx"; to have the codemod remove the experimentalFeatures prop properly.

The typescript parser parses the node as ObjectProperty while the js parser parses as Property.

I was not aware of this and I think we should be mindful of testing with both compilers before shipping new codemods.

@MBilalShafi MBilalShafi added type: bug It doesn't behave as expected. scope: data grid Changes related to the data grid. package: codemod Specific to codemod. labels Aug 9, 2024
@mui-bot
Copy link
Copy Markdown

mui-bot commented Aug 9, 2024

Deploy preview: https://deploy-preview-14150--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against aca4177

@MBilalShafi MBilalShafi marked this pull request as ready for review August 9, 2024 12:05
@MBilalShafi MBilalShafi requested a review from LukasTy August 9, 2024 12:05
@MBilalShafi MBilalShafi requested review from a team and michelengelen August 22, 2024 16:27
Comment thread packages/x-codemod/src/util/removeObjectProperty.ts Outdated
@MBilalShafi MBilalShafi enabled auto-merge (squash) September 3, 2024 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: codemod Specific to codemod. scope: data grid Changes related to the data grid. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[codemod] mui-x 7.0 migration script

3 participants