packages/material-ui-codemod/src/v1.0.0/svg-icon-imports.js
function transformSVGIconImports(j, root) {
  const pathMatchRegex = /^material-ui\/svg-icons\/.+\/(.+)$/;
  root
    .find(j.Literal)
    .filter(path => pathMatchRegex.test(path.node.value))
    .forEach(path => {
      const [, iconName] = path.node.value.match(pathMatchRegex);

      // update to new path
      path.node.value = `@material-ui/icons/${pascalize(iconName)}`;
    });
}
function transformSVGIconImports(j, root) {
  const pathMatchRegex = /^material-ui\/svg-icons\/.+\/(.+)$/;
  root
    .find(j.Literal)
    .filter(path => pathMatchRegex.test(path.node.value))
    .forEach(path => {
      const [, iconName] = path.node.value.match(pathMatchRegex);

      // update to new path
      path.node.value = `@material-ui/icons/${pascalize(iconName)}`;
    });
}
function transformSVGIconImports ( j , root ) { const pathMatchRegex = / ^material-ui\/svg-icons\/.+\/(.+)$ / ; root . find ( j . Literal ) . filter ( path => pathMatchRegex . test ( path . node . value ) ) . forEach ( path => { const [ , iconName ] = path . node . value . match ( pathMatchRegex ) ; // update to new path path . node . value = ` ${ pascalize ( iconName ) } ` ; } ) ; }
Update all `svg-icons` import references to use `@material-ui/icons` package.
Find and replace string literal AST nodes to ensure all svg-icon paths get updated, regardless
of being in an import declaration, or a require() call, etc.
https://github.com/mui-org/material-ui/tree/master/packages/@material-ui/icons
@param {jscodeshift_api_object} j
@param {jscodeshift_ast_object} root
Update all svg - icons import references to use