diff --git a/packages/mui-codemod/src/deprecations/button-group-classes/button-group-classes.js b/packages/mui-codemod/src/deprecations/button-group-classes/button-group-classes.js index 6438e578da576a..cffe90a28e2599 100644 --- a/packages/mui-codemod/src/deprecations/button-group-classes/button-group-classes.js +++ b/packages/mui-codemod/src/deprecations/button-group-classes/button-group-classes.js @@ -106,7 +106,7 @@ export default function transformer(file, api, options) { }); }); - const selectorRegex = new RegExp(`${replacementSelectorPrefix}${deprecatedClass}($)`); + const selectorRegex = new RegExp(`${replacementSelectorPrefix}${deprecatedClass}$`); root .find( j.Literal, diff --git a/packages/mui-codemod/src/deprecations/button-group-classes/button-group-classes.test.js b/packages/mui-codemod/src/deprecations/button-group-classes/button-group-classes.test.js index 95bf4d84cf9839..f01fec88ccb4a4 100644 --- a/packages/mui-codemod/src/deprecations/button-group-classes/button-group-classes.test.js +++ b/packages/mui-codemod/src/deprecations/button-group-classes/button-group-classes.test.js @@ -20,7 +20,7 @@ describe('@mui/codemod', () => { const actual = jsTransform( { source: read('./test-cases/actual.js') }, { jscodeshift }, - { printOptions: { quote: 'single', trailingComma: true } }, + { printOptions: { quote: 'double', trailingComma: true } }, ); const expected = read('./test-cases/expected.js'); diff --git a/packages/mui-codemod/src/deprecations/button-group-classes/test-cases/expected.js b/packages/mui-codemod/src/deprecations/button-group-classes/test-cases/expected.js index 06e104ac11e5f1..809d1ecfba446b 100644 --- a/packages/mui-codemod/src/deprecations/button-group-classes/test-cases/expected.js +++ b/packages/mui-codemod/src/deprecations/button-group-classes/test-cases/expected.js @@ -1,22 +1,22 @@ import { buttonGroupClasses } from '@mui/material/ButtonGroup'; -('&.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped'); -('&.MuiButtonGroup-vertical > .MuiButtonGroup-grouped'); -('&.MuiButtonGroup-text > .MuiButtonGroup-grouped'); -('&.MuiButtonGroup-text.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped'); -('&.MuiButtonGroup-text.MuiButtonGroup-vertical > .MuiButtonGroup-grouped'); -('&.MuiButtonGroup-text.MuiButtonGroup-colorPrimary > .MuiButtonGroup-grouped'); -('&.MuiButtonGroup-text.MuiButtonGroup-colorSecondary > .MuiButtonGroup-grouped'); -('&.MuiButtonGroup-outlined > .MuiButtonGroup-grouped'); -('&.MuiButtonGroup-outlined.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped'); -('&.MuiButtonGroup-outlined.MuiButtonGroup-vertical > .MuiButtonGroup-grouped'); -('&.MuiButtonGroup-outlined.MuiButtonGroup-colorPrimary > .MuiButtonGroup-grouped'); -('&.MuiButtonGroup-outlined.MuiButtonGroup-colorSecondary > .MuiButtonGroup-grouped'); -('&.MuiButtonGroup-contained > .MuiButtonGroup-grouped'); -('&.MuiButtonGroup-contained.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped'); -('&.MuiButtonGroup-contained.MuiButtonGroup-vertical > .MuiButtonGroup-grouped'); -('&.MuiButtonGroup-contained.MuiButtonGroup-colorPrimary > .MuiButtonGroup-grouped'); -('&.MuiButtonGroup-contained.MuiButtonGroup-colorSecondary > .MuiButtonGroup-grouped'); +("&.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped"); +("&.MuiButtonGroup-vertical > .MuiButtonGroup-grouped"); +("&.MuiButtonGroup-text > .MuiButtonGroup-grouped"); +("&.MuiButtonGroup-text.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped"); +("&.MuiButtonGroup-text.MuiButtonGroup-vertical > .MuiButtonGroup-grouped"); +("&.MuiButtonGroup-text.MuiButtonGroup-colorPrimary > .MuiButtonGroup-grouped"); +("&.MuiButtonGroup-text.MuiButtonGroup-colorSecondary > .MuiButtonGroup-grouped"); +("&.MuiButtonGroup-outlined > .MuiButtonGroup-grouped"); +("&.MuiButtonGroup-outlined.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped"); +("&.MuiButtonGroup-outlined.MuiButtonGroup-vertical > .MuiButtonGroup-grouped"); +("&.MuiButtonGroup-outlined.MuiButtonGroup-colorPrimary > .MuiButtonGroup-grouped"); +("&.MuiButtonGroup-outlined.MuiButtonGroup-colorSecondary > .MuiButtonGroup-grouped"); +("&.MuiButtonGroup-contained > .MuiButtonGroup-grouped"); +("&.MuiButtonGroup-contained.MuiButtonGroup-horizontal > .MuiButtonGroup-grouped"); +("&.MuiButtonGroup-contained.MuiButtonGroup-vertical > .MuiButtonGroup-grouped"); +("&.MuiButtonGroup-contained.MuiButtonGroup-colorPrimary > .MuiButtonGroup-grouped"); +("&.MuiButtonGroup-contained.MuiButtonGroup-colorSecondary > .MuiButtonGroup-grouped"); `&.${buttonGroupClasses.horizontal} > .${buttonGroupClasses.grouped}`; `&.${buttonGroupClasses.vertical} > .${buttonGroupClasses.grouped}`; `&.${buttonGroupClasses.text} > .${buttonGroupClasses.grouped}`;